diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2017-10-26 23:26:29 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2017-10-26 23:26:29 +0000 |
| commit | 0763ab4d6aefc915f573fb738e7a1fd14d74e514 (patch) | |
| tree | 6c674f51e70b7333f3b15a9c9310a085143b006c /clang/test | |
| parent | a6021e3bc12947dabedbdddb0270cb1af66a29b5 (diff) | |
| download | bcm5719-llvm-0763ab4d6aefc915f573fb738e7a1fd14d74e514.tar.gz bcm5719-llvm-0763ab4d6aefc915f573fb738e7a1fd14d74e514.zip | |
Use -fuse-init-array if no gcc installation is found.
clang currently uses .init_array instead of .ctors on Linux if it detects gcc
4.7+. Make it so that it also uses .init_array if no gcc installation is found
at all – if there's no old gcc, there's nothing we need to be compatible with.
icecc for example runs clang in a very small chroot, so before this change
clang would use .ctors if run under icecc. And lld currently silently mislinks
inputs with .ctors sections, so before this clang + icecc + lld would produce
broken binaries. (But this seems like a good change independent of that lld
bug.)
https://reviews.llvm.org/D39317
llvm-svn: 316713
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Driver/constructors.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Driver/constructors.c b/clang/test/Driver/constructors.c index 39a199a3c6a..884fbe8466c 100644 --- a/clang/test/Driver/constructors.c +++ b/clang/test/Driver/constructors.c @@ -6,6 +6,12 @@ // // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ +// RUN: --sysroot=%S/Inputs/resource_dir \ +// RUN: --gcc-toolchain="" \ +// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s +// +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-linux \ // RUN: --sysroot=%S/Inputs/fake_install_tree \ // RUN: --gcc-toolchain="" \ // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |

