From e001f3ee5b4615b4cc2bf23cc9015a362b889384 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sat, 10 Jul 2021 01:44:04 -0700 Subject: [PATCH 1/8] d/rules: Adjust cmake defines to fix libclc.pc paths Before this change, /usr/lib/pkgconfig/libclc.pc contained these invalid paths: includedir=/usr/local//usr/include libexecdir=/usr/local//usr/lib/clc Signed-off-by: Jordan Justen --- debian/changelog | 3 +++ debian/rules | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3fdda52f..3df48424 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium for llvm manifest tool (llvm-mt) (Closes: #990537) + [ Jordan Justen ] + * d/rules: Adjust cmake defines to fix libclc.pc paths + -- Sylvestre Ledru Mon, 12 Jul 2021 08:19:59 +0200 llvm-toolchain-12 (1:12.0.1-1) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index a5d9445e..1ccf2db6 100755 --- a/debian/rules +++ b/debian/rules @@ -523,8 +523,9 @@ debian-libclc-build: echo "Using cmake: $$CMAKE_BIN"; \ cd libclc/build && \ $$CMAKE_BIN ../ \ - -DCMAKE_INSTALL_DATADIR=/usr/lib \ - -DCMAKE_INSTALL_INCLUDEDIR=/usr/include \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_DATADIR=lib \ + -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CONFIG=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/llvm-config \ -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"; \ make $(NJOBS) $(VERBOSE) From 8358f9498b78ad7e15530fa5d76295c42a9279c0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 27 Jul 2021 00:07:10 +0200 Subject: [PATCH 2/8] 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) From c72a6c0e50e318c83e6bff901dd0e2e591f65145 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 27 Jul 2021 00:22:47 +0200 Subject: [PATCH 3/8] Generate libunwind-12 & libunwind-12-dev packages --- debian/changelog | 2 + debian/control | 37 ++++++ debian/libunwind-X.Y-dev.install.in | 4 + debian/libunwind-X.Y-dev.links.in | 2 + debian/libunwind-X.Y-dev.lintian-overrides.in | 1 + debian/libunwind-X.Y.install.in | 1 + debian/libunwind-X.Y.links.in | 2 + debian/libunwind-X.Y.lintian-overrides.in | 1 + debian/qualify-clang.sh | 119 +++++++++++++++++- debian/rules | 9 +- 10 files changed, 174 insertions(+), 4 deletions(-) create mode 100644 debian/libunwind-X.Y-dev.install.in create mode 100644 debian/libunwind-X.Y-dev.links.in create mode 100644 debian/libunwind-X.Y-dev.lintian-overrides.in create mode 100644 debian/libunwind-X.Y.install.in create mode 100644 debian/libunwind-X.Y.links.in create mode 100644 debian/libunwind-X.Y.lintian-overrides.in diff --git a/debian/changelog b/debian/changelog index 3df48424..c1c959b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium + * Generate libunwind-12 & libunwind-12-dev packages + [ Kasper Kantz ] * Add riscv64 architecture in control enable liblldb, libomp and others which are diff --git a/debian/control b/debian/control index 93d3cc6f..7f887bfe 100644 --- a/debian/control +++ b/debian/control @@ -713,3 +713,40 @@ Description: OpenCL C language implementation - development files as specified by the OpenCL 1.1 Specification. . This package contains development header files. + +# ------------- libunwind ------------- + +Package: libunwind-12 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Provides: libunwind-x.y +Conflicts: libunwind-x.y +Replaces: libunwind-x.y +Description: production-quality unwinder + libunwind is a production-quality unwinder, with platform support for DWARF + unwind info, SjLj, and ARM EHABI. + . + The low level libunwind API was designed to work either in-process (aka local) + or to operate on another process (aka remote), but only the local path has + been implemented. Remote unwinding remains as future work. + +Package: libunwind-12-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, +Breaks: libunwind-dev +Provides: libunwind-x.y-dev +Conflicts: libunwind-x.y-dev +Replaces: libunwind-dev, libunwind-x.y-dev +Description: production-quality unwinder + libunwind is a production-quality unwinder, with platform support for DWARF + unwind info, SjLj, and ARM EHABI. + . + The low level libunwind API was designed to work either in-process (aka local) + or to operate on another process (aka remote), but only the local path has + been implemented. Remote unwinding remains as future work. diff --git a/debian/libunwind-X.Y-dev.install.in b/debian/libunwind-X.Y-dev.install.in new file mode 100644 index 00000000..9d1ca3a3 --- /dev/null +++ b/debian/libunwind-X.Y-dev.install.in @@ -0,0 +1,4 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.so +usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.a +usr/include/libunwind + diff --git a/debian/libunwind-X.Y-dev.links.in b/debian/libunwind-X.Y-dev.links.in new file mode 100644 index 00000000..062eac8a --- /dev/null +++ b/debian/libunwind-X.Y-dev.links.in @@ -0,0 +1,2 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.so /usr/lib/x86_64-linux-gnu/libunwind.so +usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.a /usr/lib/x86_64-linux-gnu/libunwind.a diff --git a/debian/libunwind-X.Y-dev.lintian-overrides.in b/debian/libunwind-X.Y-dev.lintian-overrides.in new file mode 100644 index 00000000..6a504f74 --- /dev/null +++ b/debian/libunwind-X.Y-dev.lintian-overrides.in @@ -0,0 +1 @@ +libunwind-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.a diff --git a/debian/libunwind-X.Y.install.in b/debian/libunwind-X.Y.install.in new file mode 100644 index 00000000..e26306e4 --- /dev/null +++ b/debian/libunwind-X.Y.install.in @@ -0,0 +1 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.so.* diff --git a/debian/libunwind-X.Y.links.in b/debian/libunwind-X.Y.links.in new file mode 100644 index 00000000..663613ef --- /dev/null +++ b/debian/libunwind-X.Y.links.in @@ -0,0 +1,2 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.so.1.0 /usr/lib/@DEB_HOST_MULTIARCH@/libunwind.so.1.0 +usr/lib/@DEB_HOST_MULTIARCH@/libunwind.so.1.0 /usr/lib/@DEB_HOST_MULTIARCH@/libunwind.so.1 diff --git a/debian/libunwind-X.Y.lintian-overrides.in b/debian/libunwind-X.Y.lintian-overrides.in new file mode 100644 index 00000000..0570c00a --- /dev/null +++ b/debian/libunwind-X.Y.lintian-overrides.in @@ -0,0 +1 @@ +libunwind-@LLVM_VERSION@: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libunwind.so.1.0 diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 258bb343..f5e4ebbe 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -9,7 +9,7 @@ VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p") DETAILED_VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1\2\3,p") DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) -LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb" +LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_all.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_all.deb" echo "To install everything:" echo "sudo apt --purge remove 'libomp5-*' 'libc++*dev' 'libc++*' 'python3-lldb-*'" echo "sudo dpkg -i $LIST" @@ -1030,6 +1030,123 @@ fi LLVM_CONFIG=llvm-config-$VERSION /usr/lib/llvm-$VERSION/share/libclc/check_external_calls.sh /usr/lib/clc/amdgcn--amdhsa.bc > /dev/null +# libunwind +echo "Testing libunwind-$VERSION-dev ..." + +if test ! -f /usr/include/libunwind/unwind.h; then + echo "Install libunwind-$VERSION-dev"; + exit -1; +fi +echo ' +#include +#include + +void backtrace(int lower_bound) { + unw_context_t context; + unw_getcontext(&context); + + unw_cursor_t cursor; + unw_init_local(&cursor, &context); + + int n = 0; + do { + ++n; + if (n > 100) { + abort(); + } + } while (unw_step(&cursor) > 0); + + if (n < lower_bound) { + abort(); + } +} + +void test1(int i) { + backtrace(i); +} + +void test2(int i, int j) { + backtrace(i); + test1(j); +} + +void test3(int i, int j, int k) { + backtrace(i); + test2(j, k); +} + +void test_no_info() { + unw_context_t context; + unw_getcontext(&context); + + unw_cursor_t cursor; + unw_init_local(&cursor, &context); + + unw_proc_info_t info; + int ret = unw_get_proc_info(&cursor, &info); + if (ret != UNW_ESUCCESS) + abort(); + + // Set the IP to an address clearly outside any function. + unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)0); + + ret = unw_get_proc_info(&cursor, &info); + if (ret != UNW_ENOINFO) + abort(); +} + +int main(int, char**) { + test1(1); + test2(1, 2); + test3(1, 2, 3); + test_no_info(); + return 0; +}'> foo.cpp +clang++-$VERSION foo.cpp -lunwind -ldl -I /usr/include/libunwind +./a.out +clang++-$VERSION foo.cpp -unwindlib=libunwind -rtlib=compiler-rt -I/usr/include/libunwind +./a.out + +echo ' +#include +#include +#include +#include +#include +#include +#include +#include +#include + +_Unwind_Reason_Code frame_handler(struct _Unwind_Context* ctx, void* arg) { + (void)arg; + Dl_info info = { 0, 0, 0, 0 }; + + // Unwind util the main is reached, above frames depend on the platform and + // architecture. + if (dladdr(reinterpret_cast(_Unwind_GetIP(ctx)), &info) && + info.dli_sname && !strcmp("main", info.dli_sname)) { + _Exit(0); + } + return _URC_NO_REASON; +} + +void signal_handler(int signum) { + (void)signum; + _Unwind_Backtrace(frame_handler, NULL); + _Exit(-1); +} + +int main(int, char**) { + signal(SIGUSR1, signal_handler); + kill(getpid(), SIGUSR1); + return -2; +} +'> foo.cpp +clang++-$VERSION foo.cpp /usr/lib/llvm-$VERSION/lib/libunwind.a -I/usr/include/libunwind/ -lpthread -ldl +./a.out||true +clang++-$VERSION foo.cpp -unwindlib=libunwind -rtlib=compiler-rt -I/usr/include/libunwind -ldl +./a.out||true if test ! -f /usr/lib/llvm-$VERSION/include/polly/LinkAllPasses.h; then echo "Install libclang-common-$VERSION-dev for polly"; diff --git a/debian/rules b/debian/rules index 1ccf2db6..fd872931 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,7 @@ #!/usr/bin/make -f # polly, openmp & lldb aren't enabled for every platform -PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;debuginfo-tests -#;mlir +PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;debuginfo-tests;libunwind TARGET_BUILD := build-llvm TARGET_BUILD_STAGE2 := $(TARGET_BUILD)/tools/clang/stage2-bins @@ -408,6 +407,7 @@ override_dh_auto_configure: preconfigure -DCLANG_LINK_CLANG_DYLIB=ON \ -DENABLE_LINKER_BUILD_ID=ON \ -DCOMPILER_RT_USE_LIBCXX=NO \ + -DLIBUNWIND_USE_COMPILER_RT=ON \ $(Z3_FLAG) \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR" \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ @@ -417,7 +417,7 @@ override_dh_auto_configure: preconfigure -DLLVM_POLLY_LINK_INTO_TOOLS=ON \ -DBOOTSTRAP_CMAKE_CXX_FLAGS='$(BOOTSTRAP_CXXFLAGS_EXTRA)' \ -DBOOTSTRAP_CMAKE_C_FLAGS='$(BOOTSTRAP_CFLAGS_EXTRA)' \ - -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_INSTALL_PREFIX;CMAKE_VERBOSE_MAKEFILE;CMAKE_BUILD_TYPE;CMAKE_CXX_FLAGS_RELWITHDEBINFO;LLVM_LINK_LLVM_DYLIB;LLVM_INSTALL_UTILS;LLVM_VERSION_SUFFIX;LLVM_ENABLE_SPHINX;SPHINX_WARNINGS_AS_ERRORS;LLVM_BUILD_LLVM_DYLIB;LLVM_ENABLE_RTTI;LLVM_ENABLE_FFI;LIBCLANG_LIBRARY_VERSION;ENABLE_LINKER_BUILD_ID;POLLY_BUNDLED_JSONCPP;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;LLVM_USE_PERF;LLVM_ENABLE_ASSERTIONS;LLVM_BINUTILS_INCDIR;LLVM_HOST_TRIPLE;LLVM_COMPILER_CHECKED;COMPILER_RT_BUILD_BUILTINS;LIBOMP_LIBFLAGS;CMAKE_SHARED_LINKER_FLAGS;PYTHON_EXECUTABLE;LLVM_ENABLE_Z3_SOLVER;LLVM_POLLY_LINK_INTO_TOOLS;CLANG_VENDOR" + -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_INSTALL_PREFIX;CMAKE_VERBOSE_MAKEFILE;CMAKE_BUILD_TYPE;CMAKE_CXX_FLAGS_RELWITHDEBINFO;LLVM_LINK_LLVM_DYLIB;LLVM_INSTALL_UTILS;LLVM_VERSION_SUFFIX;LLVM_ENABLE_SPHINX;SPHINX_WARNINGS_AS_ERRORS;LLVM_BUILD_LLVM_DYLIB;LLVM_ENABLE_RTTI;LLVM_ENABLE_FFI;LIBCLANG_LIBRARY_VERSION;ENABLE_LINKER_BUILD_ID;POLLY_BUNDLED_JSONCPP;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;LLVM_USE_PERF;LLVM_ENABLE_ASSERTIONS;LLVM_BINUTILS_INCDIR;LLVM_HOST_TRIPLE;LLVM_COMPILER_CHECKED;COMPILER_RT_BUILD_BUILTINS;LIBOMP_LIBFLAGS;CMAKE_SHARED_LINKER_FLAGS;PYTHON_EXECUTABLE;LLVM_ENABLE_Z3_SOLVER;LLVM_POLLY_LINK_INTO_TOOLS;CLANG_VENDOR;LIBUNWIND_USE_COMPILER_RT" FOUND_VERSION=`grep LLVM_VERSION_STRING build-llvm/include/llvm/Config/llvm-config.h|cut -d\" -f2`; \ if ! echo "$(LLVM_VERSION_FULL)"|grep "$$FOUND_VERSION"; then \ echo "mistmatch of version. Found: $$FOUND_VERSION / Expected: $(LLVM_VERSION_FULL)"; \ @@ -619,6 +619,9 @@ override_dh_auto_install: cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && rm -f libomp.so; \ ln -s libomp.so.$(SONAME_OPENMP) libomp.so + mkdir -p debian/tmp/usr/include/libunwind + cp -R libunwind/include/* debian/tmp/usr/include/libunwind/ + if test "$(OPENMP_ENABLE)" = yes; then \ mkdir -p debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \ cp -f openmp/runtime/exports/common*/include/* debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \ From 4424a0f166d884e551c517d19b89ddf4324be1aa Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 30 Jul 2021 14:30:40 +0200 Subject: [PATCH 4/8] fix changelog --- debian/changelog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 815a6919..8e08cafd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,20 +3,20 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium * Generate libunwind-12 & libunwind-12-dev packages * 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 + * Make libc++abi use libunwind [ Kasper Kantz ] * Add riscv64 architecture in control enable liblldb, libomp and others which are currently unavailable in riscv64 repository. - [ Kasper Kantz ] + [ Krzysztof Aleksander Pyrkosz ] * Add libxml2 as a dependency as it is necessary for llvm manifest tool (llvm-mt) (Closes: #990537) - [ Krzysztof Aleksander Pyrkosz ] - [ Jordan Justen ] - * d/rules: Adjust cmake defines to fix libclc.pc paths - (Closes: #990537) [ Jordan Justen ] * d/rules: Adjust cmake defines to fix libclc.pc paths From d7b9f6065eb57c45b678665523c2dd45bf0bf2da Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 30 Jul 2021 14:48:16 +0200 Subject: [PATCH 5/8] also test the execution --- debian/qualify-clang.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index d0f584ec..f02c4094 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -952,6 +952,7 @@ clang++-$VERSION -stdlib=libc++ -static-libstdc++ -fuse-ld=lld -l:libc++abi.a te ./test clang++-$VERSION -stdlib=libc++ -nostdlib++ test.cpp -l:libc++.a -l:libc++abi.a -pthread -o test +./test # Bug 889832 echo '#include From 6b84ba401ea5a83efff2c1bd0ec37401f14315c8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 30 Jul 2021 14:49:04 +0200 Subject: [PATCH 6/8] Build libunwind --- debian/changelog | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8e08cafd..90446719 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium +<<<<<<< * Generate libunwind-12 & libunwind-12-dev packages * Add the following option to the libc++ build: -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON @@ -20,8 +21,29 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium [ Jordan Justen ] * d/rules: Adjust cmake defines to fix libclc.pc paths +======= + * 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 + * Build libunwind - -- Sylvestre Ledru Tue, 27 Jul 2021 00:01:29 +0200 + [ Kasper Kantz ] + * Add riscv64 architecture in control + enable liblldb, libomp and others which are + currently unavailable in riscv64 repository. + + [ Krzysztof Aleksander Pyrkosz ] + * Add libxml2 as a dependency as it is necessary + for llvm manifest tool (llvm-mt) + (Closes: #990537) + + [ Jordan Justen ] + * d/rules: Adjust cmake defines to fix libclc.pc paths +>>>>>>> + + -- Sylvestre Ledru Mon, 12 Jul 2021 08:19:59 +0200 llvm-toolchain-12 (1:12.0.1-1) unstable; urgency=medium From 8f6718bcb1caa40184b4287eb4540610bf0d189c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 27 Jul 2021 18:17:58 +0200 Subject: [PATCH 7/8] Make libc++abi use libunwind --- debian/changelog | 20 ++++++++++++++++++++ debian/rules | 1 + 2 files changed, 21 insertions(+) diff --git a/debian/changelog b/debian/changelog index 90446719..38594715 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,25 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium to address upstream bug 46321 * Make libc++abi use libunwind + [ Kasper Kantz ] + * Add riscv64 architecture in control + enable liblldb, libomp and others which are + currently unavailable in riscv64 repository. + + [ Krzysztof Aleksander Pyrkosz ] + * Add libxml2 as a dependency as it is necessary + for llvm manifest tool (llvm-mt) + (Closes: #990537) + + [ Jordan Justen ] + * d/rules: Adjust cmake defines to fix libclc.pc paths + * 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 + * Build libunwind + [ Kasper Kantz ] * Add riscv64 architecture in control enable liblldb, libomp and others which are @@ -28,6 +47,7 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF to address upstream bug 46321 * Build libunwind + * Make libc++abi use libunwind [ Kasper Kantz ] * Add riscv64 architecture in control diff --git a/debian/rules b/debian/rules index aa13a4ef..d3c73159 100755 --- a/debian/rules +++ b/debian/rules @@ -473,6 +473,7 @@ LIBCXX_CMAKE_OPTIONS := \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -DLIBCXX_USE_COMPILER_RT=YES \ -DLIBCXXABI_USE_COMPILER_RT=YES \ + -DLIBCXXABI_USE_LLVM_UNWINDER=YES \ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ From 13740e79aec737be5cfb5e7281da06a50d066afb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 30 Jul 2021 14:49:34 +0200 Subject: [PATCH 8/8] Fix changelog --- debian/changelog | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index 38594715..dc8e5a8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,5 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium -<<<<<<< * Generate libunwind-12 & libunwind-12-dev packages * Add the following option to the libc++ build: -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON @@ -40,28 +39,6 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium [ Jordan Justen ] * d/rules: Adjust cmake defines to fix libclc.pc paths -======= - * 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 - * Build libunwind - * Make libc++abi use libunwind - - [ Kasper Kantz ] - * Add riscv64 architecture in control - enable liblldb, libomp and others which are - currently unavailable in riscv64 repository. - - [ Krzysztof Aleksander Pyrkosz ] - * Add libxml2 as a dependency as it is necessary - for llvm manifest tool (llvm-mt) - (Closes: #990537) - - [ Jordan Justen ] - * d/rules: Adjust cmake defines to fix libclc.pc paths ->>>>>>> -- Sylvestre Ledru Mon, 12 Jul 2021 08:19:59 +0200