From 8358f9498b78ad7e15530fa5d76295c42a9279c0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 27 Jul 2021 00:07:10 +0200 Subject: [PATCH] Add the following option to the libc++ build: -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF to address upstream bug 46321 --- debian/changelog | 8 +++++++- debian/qualify-clang.sh | 14 ++++++++++++++ debian/rules | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3df48424..02255d62 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,11 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium + * Add the following option to the libc++ build: + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON + -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF + to address upstream bug 46321 + [ Kasper Kantz ] * Add riscv64 architecture in control enable liblldb, libomp and others which are @@ -13,7 +19,7 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium [ Jordan Justen ] * d/rules: Adjust cmake defines to fix libclc.pc paths - -- Sylvestre Ledru Mon, 12 Jul 2021 08:19:59 +0200 + -- Sylvestre Ledru Tue, 27 Jul 2021 00:01:29 +0200 llvm-toolchain-12 (1:12.0.1-1) unstable; urgency=medium diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 258bb343..fc994ada 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -939,6 +939,20 @@ clang++-$VERSION -std=c++11 -stdlib=libc++ foo.cpp -o o clang++-$VERSION -std=c++14 -stdlib=libc++ foo.cpp -lc++experimental -o o ./o > /dev/null +# Bug 46321 +cat > test.cpp << EOF +#include +int main() { + std::cout << "Hello World!" << std::endl; +} +EOF +clang++-$VERSION -stdlib=libc++ -unwindlib=libunwind -rtlib=compiler-rt -static-libstdc++ -static-libgcc test.cpp &> /dev/null || true + +clang++-$VERSION -stdlib=libc++ -static-libstdc++ -fuse-ld=lld -l:libc++abi.a test.cpp -o test +./test + +clang++-$VERSION -stdlib=libc++ -nostdlib++ test.cpp -l:libc++.a -l:libc++abi.a -pthread -o test + # Bug 889832 echo '#include int main() {}' | clang++-$VERSION -std=c++1z -x c++ -stdlib=libc++ - diff --git a/debian/rules b/debian/rules index 1ccf2db6..98138732 100755 --- a/debian/rules +++ b/debian/rules @@ -473,6 +473,9 @@ LIBCXX_CMAKE_OPTIONS := \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -DLIBCXX_USE_COMPILER_RT=YES \ -DLIBCXXABI_USE_COMPILER_RT=YES \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ $(CMAKE_EXTRA) \ $(CMAKE_EXTRA_LIBCXX)