diff options
author | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-07-27 08:15:54 +0000 |
---|---|---|
committer | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-07-27 08:15:54 +0000 |
commit | d196fa524fa483a6195f6f079b0ee82dba03db1f (patch) | |
tree | c49889501e16de7bc63ef8f8d0e35dd29d99ca96 /clang/test/OpenMP | |
parent | 7094aa4f8d9cf64c56e07966b993c593bc8c73d8 (diff) | |
download | bcm5719-llvm-d196fa524fa483a6195f6f079b0ee82dba03db1f.tar.gz bcm5719-llvm-d196fa524fa483a6195f6f079b0ee82dba03db1f.zip |
Support setting default value for -rtlib at build time
This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru
which we can specify a default value for -rtlib (libgcc or
compiler-rt) at build time, just like how we set the default C++
stdlib thru CLANG_DEFAULT_CXX_STDLIB.
With these two options, we can configure clang to build binaries on
Linux that have no runtime dependence on any gcc libs (libstdc++ or
libgcc_s).
Patch by Lei Zhang!
Differential Revision: https://reviews.llvm.org/D22663
llvm-svn: 276848
Diffstat (limited to 'clang/test/OpenMP')
-rw-r--r-- | clang/test/OpenMP/linking.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/test/OpenMP/linking.c b/clang/test/OpenMP/linking.c index 81706d4f620..7b305924237 100644 --- a/clang/test/OpenMP/linking.c +++ b/clang/test/OpenMP/linking.c @@ -4,42 +4,42 @@ // FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp -target i386-unknown-linux \ +// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" // CHECK-LD-32: "-lpthread" "-lc" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp -target x86_64-unknown-linux \ +// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" // CHECK-LD-64: "-lpthread" "-lc" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp=libgomp -target i386-unknown-linux \ +// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s // CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}" // CHECK-GOMP-LD-32: "-lgomp" "-lrt" "-lgcc" // CHECK-GOMP-LD-32: "-lpthread" "-lc" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp=libgomp -target x86_64-unknown-linux \ +// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s // CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}" // CHECK-GOMP-LD-64: "-lgomp" "-lrt" "-lgcc" // CHECK-GOMP-LD-64: "-lpthread" "-lc" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp -target i386-unknown-linux \ +// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}" // CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" // CHECK-IOMP5-LD-32: "-lpthread" "-lc" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp -target x86_64-unknown-linux \ +// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" // CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" @@ -57,6 +57,7 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \ +// RUN: -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s // CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt" "-lgcc" @@ -64,13 +65,14 @@ // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \ +// RUN: -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s // CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt" "-lgcc" // CHECK-LD-OVERRIDE-64: "-lpthread" "-lc" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp=libomp -target x86_64-msvc-win32 \ +// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s // CHECK-MSVC-LINK-64: link.exe // CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib @@ -79,7 +81,7 @@ // CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 \ +// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform \ // RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s // CHECK-MSVC-ILINK-64: link.exe // CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcomp.lib |