mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-13 17:46:06 +00:00

Projects that want to statically link their own C++ standard library currently need to pass -nostdlib or -nodefaultlibs, which also disables linking of the builtins library, -lm, and so on. Alternatively, they could use `clang` instead of `clang++`, but that already disables implicit addition of -lm on some toolchains. Add a dedicated flag -nostdlib++ that disables just linking of libc++ / libstdc++. This is analogous to -nostdinc++. https://reviews.llvm.org/D35780 llvm-svn: 308997
9 lines
230 B
C++
9 lines
230 B
C++
// RUN: %clangxx -target i686-pc-linux-gnu -### -nostdlib++ %s 2> %t
|
|
// RUN: FileCheck < %t %s
|
|
|
|
// We should still have -lm and the C standard libraries, but not -lstdc++.
|
|
|
|
// CHECK-NOT: -lstdc++
|
|
// CHECK-NOT: -lc++
|
|
// CHECK: -lm
|