This is an archive of the discontinued LLVM Phabricator instance.

Add -link-cxx-sanitizer driver flag.
ClosedPublic

Authored by samsonov on Aug 7 2014, 12:53 PM.

Details

Summary

This flag can be used to force linking of CXX-specific parts
of sanitizer runtimes into the final executable. It gives more precise
control than --driver-mode=g++ and comes handy when user links several
object files with sanitized C++ code into an executable, but wants
to provide libstdc++ himself, instead of relying on Clang dirver's
behavior.

Diff Detail

Event Timeline

samsonov updated this revision to Diff 12287.Aug 7 2014, 12:53 PM
samsonov retitled this revision from to Add -link-cxx-sanitizer driver flag..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added reviewers: rsmith, chandlerc.
samsonov added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Aug 7 2014, 2:08 PM
include/clang/Driver/Options.td
388

Seems like a bad flag name choice; this already means "link to libink-cxx-sanitizer". Please use a double-dash prefix or similar. Is there any other similar flag name that this could be modeled after?

samsonov updated this revision to Diff 12292.Aug 7 2014, 2:37 PM

Rename the flag to --link-cxx-sanitizer.

include/clang/Driver/Options.td
388

Good catch. Renamed to --link-cxx-sanitizer. I wasn't able to come up with similar flag...

rsmith added inline comments.Aug 8 2014, 10:40 AM
include/clang/Driver/Options.td
1537

I took a look though our existing flags, and only thing similar to this that I could find was -fobjc-link-runtime. Maybe something like -fsanitize-link-c++-runtime?

samsonov updated this revision to Diff 12315.Aug 8 2014, 3:44 PM

Rename the flag to -fsanitize-link-c++-runtime.

include/clang/Driver/Options.td
1537

Good idea. Renamed.

rsmith accepted this revision.Aug 8 2014, 3:49 PM
rsmith edited edge metadata.

LGTM

This revision is now accepted and ready to land.Aug 8 2014, 3:49 PM
samsonov closed this revision.Aug 8 2014, 3:56 PM