[asan] A clang flag to enable ELF globals-gc.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 9 May 2017 21:57:43 +0000 (21:57 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 9 May 2017 21:57:43 +0000 (21:57 +0000)
commitd991cdd50bea4bca96336303a68348332b50b39d
tree43571c2a525b83c344973ac5dace8679a7d34bd8
parentb86ca11b577e813032747147f1975448bc440ec1
[asan] A clang flag to enable ELF globals-gc.

This feature is subtly broken when the linker is gold 2.26 or
earlier. See the following bug for details:
  https://sourceware.org/bugzilla/show_bug.cgi?id=19002

Since the decision needs to be made at compilation time, we can not
test the linker version. The flag is off by default on ELF targets,
and on otherwise.

llvm-svn: 302591
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/SanitizerArgs.h
clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/asan-globals-gc.cpp
clang/test/Driver/fsanitize.c