llvm-project/clang/lib/Driver
Alexey Samsonov ecfd5c84ca Revert r218541 - Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.
This is a sad thing to do, but all the alternatives look ugly.

Looks like there are legitimate cases when users may want to link
with sanitizer runtimes *and* -nodefaultlibs (and ensure they provide
replacements for system libraries). For example, this happens in libc++
test suite.

"-nodefaultlibs" is told to link only the libraries explicitly provided
by the user, and providing "-fsanitize=address" is a clear indication of
intention to link with ASan runtime.
We can't easily introduce analogue of "-print-libgcc-name": linking with
sanitizers runtimes is not trivial: some runtimes are split into several
archive libraries, which are required to be wrapped in
-whole-archive/-no-whole-archive.

If "-fsanitize=whatever" and "-nodefaultlibs" are provided, system library
dependencies of sanitizer runtimes (-lc/-ldl/-lpthread/-lrt) will *not* be
linked, and user would have to link them in manually. Note that this can
cause problems, as failing to provide "-lrt" might lead to crashes in runtime
during ASan initialization. But looks like we should bite this bullet.

See r218541 review thread for the discussion.

llvm-svn: 220455
2014-10-23 00:46:10 +00:00
..
Action.cpp unique_ptrify Driver Action handling 2014-08-29 07:25:23 +00:00
CMakeLists.txt Driver: rename Windows to MSVCToolChain 2014-10-22 02:37:29 +00:00
Compilation.cpp Driver: Use pointee_iterator rather than iterating over unique_ptrs 2014-10-03 01:04:53 +00:00
Driver.cpp Driver: rename Windows to MSVCToolChain 2014-10-22 02:37:29 +00:00
DriverOptions.cpp Remove the SUPPORT_ALIASARGS define 2013-08-01 00:12:13 +00:00
InputInfo.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00
Job.cpp Driver: Quote the command in crash reproduction scripts. 2014-10-21 18:03:08 +00:00
MSVCToolChain.cpp Fix C++ compliance issue. string literals must be const char * 2014-10-22 21:48:56 +00:00
Makefile
Multilib.cpp Driver: Simplify a use of the path API 2014-08-03 21:46:33 +00:00
Phases.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
SanitizerArgs.cpp clang-cl: Diagnose the usage of ASAN with a debug runtime library 2014-10-14 23:15:44 +00:00
Tool.cpp Teach Clang how to use response files when calling other tools 2014-09-15 17:45:39 +00:00
ToolChain.cpp CFE Knob for: Add a thread-model knob for lowering atomics on baremetal & single threaded systems 2014-10-03 21:57:44 +00:00
ToolChains.cpp Use non-member begin/end for a slight readability improvement. 2014-10-18 10:43:51 +00:00
ToolChains.h Make a good guess about where MSVC and Windows SDK libraries are for linking. 2014-10-22 20:40:43 +00:00
Tools.cpp Revert r218541 - Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided. 2014-10-23 00:46:10 +00:00
Tools.h Revert changes in r218863, r218864 2014-10-03 09:11:41 +00:00
Types.cpp Recognize .lib files as linker input explicitly 2014-09-10 17:15:00 +00:00