[PATCH] Driver: implement --runtime-sysroot option.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri May 24 06:39:12 PDT 2013


> Why not use -Wl,--dynamic-linker for this?  Well, one of the goals of
> the sanitizer tools is ease of use.  It would not be user friendly to
> require the user to supply the correct path to the dynamic loader
> (which can vary depending on the platform) in order to enable
> full-process compile-time instrumentation.  One could also consider
> infrastructure which would cause -fsanitize=* options to imply an
> appropriate runtime sysroot, for which the ability to specify the
> runtime sysroot would be an important prerequisite.

Having instrumented versions of libc would be  awesome!

I guess the name of the libraries itself can be backed in to
-fsanitize=*. So for example the driver would pass -lasan-c to the
linker for example. For the linker search path, the existing logic
should be sufficient. The issue is how should we search for the
dynamic linker. Some notes

* We should not assume it is not in a system directory. Now that some
BSD use clang as their system compiler they might be interested in
having instrumented libc's available.
* Can we just search a path relative to the driver install location in
addition to system directories? This would be similar to how we look
for libstdr++ for example.

If those don't work, I think my only remaining objection to this patch
is the option name sounds a bit too generic. What about dyld-path or
even sanitazer-libc-path?

Cheers,
Rafael



More information about the cfe-commits mailing list