From c13342da425a284381d4f5c86fc877a5018aaefb Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 2 Nov 2020 21:52:30 +0200 Subject: [PATCH 01/38] Fix the fuzzer build on i386 --- debian/changelog | 7 +++ .../patches/disable-fuzzer-compiler-rt.diff | 43 ------------------- debian/patches/series | 3 +- debian/patches/x86-fuzzer.patch | 14 ++++++ 4 files changed, 23 insertions(+), 44 deletions(-) delete mode 100644 debian/patches/disable-fuzzer-compiler-rt.diff create mode 100644 debian/patches/x86-fuzzer.patch diff --git a/debian/changelog b/debian/changelog index bf000b9b..a5787469 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-9 (1:9.0.1-16) UNRELEASED; urgency=medium + + [ Adrian Bunk ] + * Fix the fuzzer build on i386. + + -- Adrian Bunk Thu, 05 Nov 2020 20:50:05 +0200 + llvm-toolchain-9 (1:9.0.1-15) unstable; urgency=low * Replace use of deprecated $ADTTMP with $AUTOPKGTEST_TMP. diff --git a/debian/patches/disable-fuzzer-compiler-rt.diff b/debian/patches/disable-fuzzer-compiler-rt.diff deleted file mode 100644 index 98155252..00000000 --- a/debian/patches/disable-fuzzer-compiler-rt.diff +++ /dev/null @@ -1,43 +0,0 @@ -Index: llvm-toolchain-9-9.0.0/compiler-rt/lib/CMakeLists.txt -=================================================================== ---- llvm-toolchain-9-9.0.0.orig/compiler-rt/lib/CMakeLists.txt -+++ llvm-toolchain-9-9.0.0/compiler-rt/lib/CMakeLists.txt -@@ -57,5 +57,8 @@ if(COMPILER_RT_BUILD_XRAY) - endif() - - if(COMPILER_RT_BUILD_LIBFUZZER) -- compiler_rt_build_runtime(fuzzer) -+ if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i386" AND -+ NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686") -+ compiler_rt_build_runtime(fuzzer) -+ endif() - endif() -Index: llvm-toolchain-9-9.0.0/clang/runtime/CMakeLists.txt -=================================================================== ---- llvm-toolchain-9-9.0.0.orig/clang/runtime/CMakeLists.txt -+++ llvm-toolchain-9-9.0.0/clang/runtime/CMakeLists.txt -@@ -130,7 +130,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND E - FileCheck count not llvm-nm llvm-objdump llvm-symbolizer) - - # Add top-level targets for various compiler-rt test suites. -- set(COMPILER_RT_TEST_SUITES check-fuzzer check-asan check-hwasan check-asan-dynamic check-dfsan -+ set(COMPILER_RT_TEST_SUITES check-asan check-hwasan check-asan-dynamic check-dfsan - check-lsan check-msan check-sanitizer check-tsan check-ubsan check-ubsan-minimal - check-profile check-cfi check-cfi-and-supported check-safestack check-gwp_asan) - foreach(test_suite ${COMPILER_RT_TEST_SUITES}) -Index: llvm-toolchain-9-9.0.0/compiler-rt/test/CMakeLists.txt -=================================================================== ---- llvm-toolchain-9-9.0.0.orig/compiler-rt/test/CMakeLists.txt -+++ llvm-toolchain-9-9.0.0/compiler-rt/test/CMakeLists.txt -@@ -57,7 +57,10 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS) - - # OpenBSD not supporting asan, cannot run the tests - if(COMPILER_RT_BUILD_LIBFUZZER AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" AND NOT ANDROID) -- compiler_rt_test_runtime(fuzzer) -+ if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i386" AND -+ NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686") -+ compiler_rt_test_runtime(fuzzer) -+ endif() - endif() - - foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD}) diff --git a/debian/patches/series b/debian/patches/series index 3833ee7a..7ad053fd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -136,9 +136,10 @@ D74453-riscv-atomic_cmp_xchg.diff #try-to-unbreak-thinlto.diff D67877.patch disable-lit-cpuid-install.diff -disable-fuzzer-compiler-rt.diff no-z3.patch +x86-fuzzer.patch + # bug #946874 D71028-mips-rust-test.diff python3-shebang.patch diff --git a/debian/patches/x86-fuzzer.patch b/debian/patches/x86-fuzzer.patch new file mode 100644 index 00000000..1e1895e8 --- /dev/null +++ b/debian/patches/x86-fuzzer.patch @@ -0,0 +1,14 @@ +Description: fuzzer: EMULATION_ARGUMENT is also required when building on i386 for x86_64 +Author: Adrian Bunk + +--- llvm-toolchain-11-11.0.0.orig/compiler-rt/lib/fuzzer/CMakeLists.txt ++++ llvm-toolchain-11-11.0.0/compiler-rt/lib/fuzzer/CMakeLists.txt +@@ -121,6 +121,8 @@ if(OS_NAME MATCHES "Linux|Fuchsia" AND + macro(partially_link_libcxx name dir arch) + if(${arch} MATCHES "i386") + set(EMULATION_ARGUMENT "-m" "elf_i386") ++ elseif(${arch} MATCHES "x86_64") ++ set(EMULATION_ARGUMENT "-m" "elf_x86_64") + else() + set(EMULATION_ARGUMENT "") + endif() From cddedcf42554ace26a2f37518fdcab62da273b9a Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Fri, 8 Jan 2021 12:48:05 +0100 Subject: [PATCH 02/38] Add two patches backported to fix ppc64el julia build (Closes: #974779) --- debian/patches/llvm-9.0-D78196.patch | 15 ++++++ .../llvm9-D71443-PPC-MC-redef-symbol.patch | 47 +++++++++++++++++++ debian/patches/series | 4 ++ 3 files changed, 66 insertions(+) create mode 100644 debian/patches/llvm-9.0-D78196.patch create mode 100644 debian/patches/llvm9-D71443-PPC-MC-redef-symbol.patch diff --git a/debian/patches/llvm-9.0-D78196.patch b/debian/patches/llvm-9.0-D78196.patch new file mode 100644 index 00000000..a5e03c01 --- /dev/null +++ b/debian/patches/llvm-9.0-D78196.patch @@ -0,0 +1,15 @@ +diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp ++++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +@@ -198,6 +198,10 @@ + for (auto *Sym : UpdateOther) + if (Sym->isVariable()) + copyLocalEntry(Sym, Sym->getVariableValue()); ++ ++ // Clear the set of symbols that needs to be updated so the streamer can ++ // be reused without issues. ++ UpdateOther.clear(); + } + + private: + diff --git a/debian/patches/llvm9-D71443-PPC-MC-redef-symbol.patch b/debian/patches/llvm9-D71443-PPC-MC-redef-symbol.patch new file mode 100644 index 00000000..f6828eed --- /dev/null +++ b/debian/patches/llvm9-D71443-PPC-MC-redef-symbol.patch @@ -0,0 +1,47 @@ +From 5cd52dbfa9c60cfd12676924bed97701ee9bc4ef Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Thu, 12 Dec 2019 16:18:57 -0800 +Subject: [PATCH] [MC][PowerPC] Fix a crash when redefining a symbol after .set + +Fix PR44284. This is probably not valid assembly but we should not crash. + +Reviewed By: luporl, #powerpc, steven.zhang + +Differential Revision: https://reviews.llvm.org/D71443 + +(cherry picked from commit f99eedeb72644671cd584f48e4c136d47f6b0020) +--- + llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | 3 ++- + llvm/test/MC/PowerPC/ppc64-localentry-symbols.s | 5 +++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +index 90c3c8d20ed..71f926c265e 100644 +--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp ++++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +@@ -196,7 +196,8 @@ public: + + void finish() override { + for (auto *Sym : UpdateOther) +- copyLocalEntry(Sym, Sym->getVariableValue()); ++ if (Sym->isVariable()) ++ copyLocalEntry(Sym, Sym->getVariableValue()); + } + + private: +diff --git llvm/test/MC/PowerPC/ppc64-localentry-symbols.s llvm/test/MC/PowerPC/ppc64-localentry-symbols.s +index f1d5c5d0ab1..a663af57ad4 100644 +--- a/llvm/test/MC/PowerPC/ppc64-localentry-symbols.s ++++ b/llvm/test/MC/PowerPC/ppc64-localentry-symbols.s +@@ -32,3 +32,8 @@ func: + nop + nop + .localentry func, 8 ++ ++## PR44284 Don't crash if err is redefined after .set ++.set err, _err ++.globl err ++err: +-- +2.26.0 + diff --git a/debian/patches/series b/debian/patches/series index 7ad053fd..c688aa14 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -153,3 +153,7 @@ riscv64-multilib-empty.patch f8e146f3430de3a6cd904f3f3f7aa1bfaefee14c.patch 3185c30c54d0af5bffbff3bcfd721668d086ff10.patch + +# bug 974779 +llvm9-D71443-PPC-MC-redef-symbol.patch +llvm-9.0-D78196.patch From fc2e0fecf3d945e3589b13e94f66648d49e8ceb2 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Fri, 8 Jan 2021 12:50:04 +0100 Subject: [PATCH 03/38] Update changelog, upload to sid --- debian/changelog | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a5787469..39894ff4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,12 @@ -llvm-toolchain-9 (1:9.0.1-16) UNRELEASED; urgency=medium +llvm-toolchain-9 (1:9.0.1-16) unstable; urgency=medium [ Adrian Bunk ] * Fix the fuzzer build on i386. - -- Adrian Bunk Thu, 05 Nov 2020 20:50:05 +0200 + [ Gianfranco Costamagna ] + * Add two patches backported to fix ppc64el julia build (Closes: #974779) + + -- Gianfranco Costamagna Fri, 08 Jan 2021 12:48:25 +0100 llvm-toolchain-9 (1:9.0.1-15) unstable; urgency=low From aedba4a93a515820f376a114814d653a16aa06c4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 1 Mar 2021 14:39:38 +0100 Subject: [PATCH 04/38] Only enable libomp-9-doc on supported archs --- debian/changelog | 6 ++++++ debian/control | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bf000b9b..4f430f2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-9 (1:9.0.1-16) unstable; urgency=medium + + * Only enable libomp-9-doc on supported archs + + -- Sylvestre Ledru Mon, 01 Mar 2021 10:44:34 +0100 + llvm-toolchain-9 (1:9.0.1-15) unstable; urgency=low * Replace use of deprecated $ADTTMP with $AUTOPKGTEST_TMP. diff --git a/debian/control b/debian/control index a08ecb56..d9bd7d54 100644 --- a/debian/control +++ b/debian/control @@ -559,7 +559,7 @@ Description: LLVM OpenMP runtime Package: libomp-9-doc Section: doc -Architecture: all +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery Replaces: libiomp-x.y-doc Breaks: libiomp-x.y-doc From c5da4109de0084d515c531033e4fe0fce7305ee8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 8 Mar 2021 12:05:15 +0100 Subject: [PATCH 05/38] Remove an old breaks/replaces for 9 which was causing some issues on Debian buster. Thanks to Julien Wajsberg for the bug report --- debian/changelog | 8 ++++++++ debian/control | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 09125514..e5e753c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-9 (1:9.0.1-17) unstable; urgency=medium + + * Remove an old breaks/replaces for 9 which was causing + some issues on Debian buster. Thanks to Julien Wajsberg + for the bug report + + -- Sylvestre Ledru Mon, 08 Mar 2021 12:05:07 +0100 + llvm-toolchain-9 (1:9.0.1-16) unstable; urgency=medium * Only enable libomp-9-doc on supported archs diff --git a/debian/control b/debian/control index d9bd7d54..58b2302b 100644 --- a/debian/control +++ b/debian/control @@ -348,9 +348,6 @@ Package: llvm-9-tools Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, python3, python3-pygments, python3-yaml -# Because of yaml-bench -Breaks: libclang-common-9-dev (<< 1:9.0.1~+rc2) -Replaces: libclang-common-9-dev (<< 1:9.0.1~+rc2) Description: Modular compiler and toolchain technologies, tools LLVM is a collection of libraries and tools that make it easy to build compilers, optimizers, just-in-time code generators, and many other From e2a02c21cefbc1283f96c05a2c4d21d46e197296 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 27 Mar 2021 11:51:09 +0100 Subject: [PATCH 06/38] On some arch, we need another version of cmake. in some case, it needs a specific version of the lib. So, provide the ld_library_path for these --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index ab8eb412..aec50a34 100755 --- a/debian/rules +++ b/debian/rules @@ -356,6 +356,7 @@ override_dh_auto_configure: preconfigure CMAKE_BIN=cmake; \ if test -f /tmp/cmake/bin/cmake; then \ CMAKE_BIN=/tmp/cmake/bin/cmake; \ + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ fi; \ echo "Using cmake: $$CMAKE_BIN"; \ cd $(TARGET_BUILD) && \ From bd01f7d5ed70934e68aea50d8e71d2d66fcfe856 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 27 Mar 2021 12:18:31 +0100 Subject: [PATCH 07/38] On some arch, we need another version of cmake. in some case, it needs a specific version of the lib. So, provide the ld_library_path for these --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index aec50a34..5140dc03 100755 --- a/debian/rules +++ b/debian/rules @@ -395,6 +395,9 @@ VERBOSE=VERBOSE=1 #VERBOSE=-v debian-full-build: + if test -f /tmp/cmake/bin/cmake; then \ + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ + fi; \ $(PRE_PROCESS) make $(NJOBS) -C $(TARGET_BUILD) $(VERBOSE) CFLAGS="$(CFLAGS_EXTRA)" CXXFLAGS="$(CXXFLAGS_EXTRA)" LDFLAGS="$(LDFLAGS_EXTRA)" REQUIRES_RTTI=1 DEBUGMAKE=1 $(BUILD_METHOD) # Check the stage 2 build worked @@ -444,6 +447,7 @@ debian-libcxx-build: CMAKE_BIN=cmake; \ if test -f /tmp/cmake/bin/cmake; then \ CMAKE_BIN=/tmp/cmake/bin/cmake; \ + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ fi; \ echo "Using cmake: $$CMAKE_BIN"; \ cd libcxxabi/build && \ @@ -465,6 +469,7 @@ debian-libcxxabi-build: CMAKE_BIN=cmake; \ if test -f /tmp/cmake/bin/cmake; then \ CMAKE_BIN=/tmp/cmake/bin/cmake; \ + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ fi; \ echo "Using cmake: $$CMAKE_BIN"; \ cd libcxx/build && \ From 44c787d48250de34712c2ca160f645e762c143e3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 27 Mar 2021 13:38:49 +0100 Subject: [PATCH 08/38] try workaround cmake in a better way as it wasn't working all the time make -j 7 -C build-llvm/tools/clang/stage2-bins docs-llvm-html docs-clang-html docs-clang-tools-html docs-clang-tools-man docs-clang-man docs-llvm-man make[2]: Entering directory '/build/llvm-toolchain-9-9~+20210327121910+c1a0a213378a/build-llvm/tools/clang/stage2-bins' /tmp/cmake/bin/cmake -S"/build/llvm-toolchain-9-9~+20210327121910+c1a0a213378a/llvm" -B"/build/llvm-toolchain-9-9~+20210327121910+c1a0a213378a/build-llvm/tools/clang/stage2-bins" --check-build-system CMakeFiles/Makefile.cmake 0 /tmp/cmake/bin/cmake: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory Makefile:39750: recipe for target 'cmake_check_build_system' failed --- debian/rules | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/debian/rules b/debian/rules index 5140dc03..34ebf662 100755 --- a/debian/rules +++ b/debian/rules @@ -281,6 +281,14 @@ ifneq (,$(filter $(DEB_HOST_ARCH), mips64 mips64el)) LIBOMP_ARCH = mips64 endif +# if cmake is installed in /tmp/cmake/ uses it +# Used to build llvm on old ubuntu (precise) on the llvm.org/apt/ ci +CMAKE_BIN=cmake; \ + +ifeq (,$(wildcard /tmp/cmake/bin/cmake)) + CMAKE_BIN=/tmp/cmake/bin/cmake + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/ +endif %: dh $@ $(DH_OPTIONS) @@ -350,13 +358,7 @@ override_dh_auto_configure: preconfigure fi) echo "Running tests: $(RUN_TEST)" - - # if cmake is installed in /tmp/cmake/ uses it - # Used to build llvm on old ubuntu (precise) on the llvm.org/apt/ ci - CMAKE_BIN=cmake; \ if test -f /tmp/cmake/bin/cmake; then \ - CMAKE_BIN=/tmp/cmake/bin/cmake; \ - export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ fi; \ echo "Using cmake: $$CMAKE_BIN"; \ cd $(TARGET_BUILD) && \ @@ -395,9 +397,6 @@ VERBOSE=VERBOSE=1 #VERBOSE=-v debian-full-build: - if test -f /tmp/cmake/bin/cmake; then \ - export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ - fi; \ $(PRE_PROCESS) make $(NJOBS) -C $(TARGET_BUILD) $(VERBOSE) CFLAGS="$(CFLAGS_EXTRA)" CXXFLAGS="$(CXXFLAGS_EXTRA)" LDFLAGS="$(LDFLAGS_EXTRA)" REQUIRES_RTTI=1 DEBUGMAKE=1 $(BUILD_METHOD) # Check the stage 2 build worked @@ -444,11 +443,6 @@ debian-libcxx-build: mkdir -p libcxx/build mkdir -p libcxxabi/build - CMAKE_BIN=cmake; \ - if test -f /tmp/cmake/bin/cmake; then \ - CMAKE_BIN=/tmp/cmake/bin/cmake; \ - export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ - fi; \ echo "Using cmake: $$CMAKE_BIN"; \ cd libcxxabi/build && \ $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \ @@ -466,11 +460,6 @@ debian-libcxxabi-build: mkdir -p libcxxabi/build - CMAKE_BIN=cmake; \ - if test -f /tmp/cmake/bin/cmake; then \ - CMAKE_BIN=/tmp/cmake/bin/cmake; \ - export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/; \ - fi; \ echo "Using cmake: $$CMAKE_BIN"; \ cd libcxx/build && \ $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \ From 6504f1c20d8ddb151bc3563c4ae5dafb95ddb290 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 27 Mar 2021 13:42:51 +0100 Subject: [PATCH 09/38] unbreak 9 --- debian/rules | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/debian/rules b/debian/rules index 34ebf662..e583087e 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,5 @@ #!/usr/bin/make -f - +65;6201;1c # polly, openmp & lldb aren't enabled for every platform PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;debuginfo-tests @@ -283,9 +283,8 @@ endif # if cmake is installed in /tmp/cmake/ uses it # Used to build llvm on old ubuntu (precise) on the llvm.org/apt/ ci -CMAKE_BIN=cmake; \ - -ifeq (,$(wildcard /tmp/cmake/bin/cmake)) +CMAKE_BIN=cmake +ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) CMAKE_BIN=/tmp/cmake/bin/cmake export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/ endif @@ -358,11 +357,9 @@ override_dh_auto_configure: preconfigure fi) echo "Running tests: $(RUN_TEST)" - if test -f /tmp/cmake/bin/cmake; then \ - fi; \ - echo "Using cmake: $$CMAKE_BIN"; \ + echo "Using cmake: $(CMAKE_BIN)"; \ cd $(TARGET_BUILD) && \ - $(PRE_PROCESS_CONF) $$CMAKE_BIN ../llvm/ \ + $(PRE_PROCESS_CONF) $(CMAKE_BIN) ../llvm/ \ -DLLVM_ENABLE_PROJECTS="$(PROJECTS_LIST)" \ -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -443,9 +440,9 @@ debian-libcxx-build: mkdir -p libcxx/build mkdir -p libcxxabi/build - echo "Using cmake: $$CMAKE_BIN"; \ + echo "Using cmake: $(CMAKE_BIN)"; \ cd libcxxabi/build && \ - $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \ + $(PRE_PROCESS_CONF) $(CMAKE_BIN) ../ \ $(LIBCXX_CMAKE_OPTIONS) \ -DLIBCXXABI_LIBCXX_PATH=$(BASE_PATH)/libcxx \ -DLIBCXXABI_LIBCXX_LIBRARY_PATH=$(BASE_PATH)/libcxx/build/lib \ @@ -460,9 +457,9 @@ debian-libcxxabi-build: mkdir -p libcxxabi/build - echo "Using cmake: $$CMAKE_BIN"; \ + echo "Using cmake: $(CMAKE_BIN)"; \ cd libcxx/build && \ - $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \ + $(PRE_PROCESS_CONF) $(CMAKE_BIN) ../ \ $(LIBCXX_CMAKE_OPTIONS) \ -DLIBCXX_CXX_ABI=libcxxabi \ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=$(BASE_PATH)/libcxxabi/include \ From 814c946debe2fd7ebb2caaf0762e1c447041a598 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 27 Mar 2021 13:43:32 +0100 Subject: [PATCH 10/38] unbreak 9 --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index e583087e..fd9f63d4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,5 @@ #!/usr/bin/make -f -65;6201;1c + # polly, openmp & lldb aren't enabled for every platform PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;debuginfo-tests From 49f95a20989ac82b95681cc5dcaf5b06d8eb9a11 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 28 Mar 2021 09:50:08 +0200 Subject: [PATCH 11/38] Try to fix the fakeroot error --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index fd9f63d4..8c96e6df 100755 --- a/debian/rules +++ b/debian/rules @@ -286,7 +286,7 @@ endif CMAKE_BIN=cmake ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) CMAKE_BIN=/tmp/cmake/bin/cmake - export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/ + export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/tmp/cmake/bin/ endif %: @@ -805,7 +805,7 @@ ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS))) ln -s lldb/_lldb.so; \ fi if test "$(CODECOVERAGE)" = "no"; then \ - LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ $(MAKE) $(NJOBS) -C $(TARGET_BUILD) check-lldb || true; \ + LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/$(TARGET_BUILD)/lib/ $(MAKE) $(NJOBS) -C $(TARGET_BUILD) check-lldb || true; \ fi # remove the workaround rm $(CURDIR)/$(TARGET_BUILD)/lib/python*/*-packages/_lldb.so From 6ee77b9fb5e33d07d202a29a5752a187fddbc260 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 28 Mar 2021 10:11:42 +0200 Subject: [PATCH 12/38] Revert "Try to fix the fakeroot error" This reverts commit 49f95a20989ac82b95681cc5dcaf5b06d8eb9a11. --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 8c96e6df..fd9f63d4 100755 --- a/debian/rules +++ b/debian/rules @@ -286,7 +286,7 @@ endif CMAKE_BIN=cmake ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) CMAKE_BIN=/tmp/cmake/bin/cmake - export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/tmp/cmake/bin/ + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/ endif %: @@ -805,7 +805,7 @@ ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS))) ln -s lldb/_lldb.so; \ fi if test "$(CODECOVERAGE)" = "no"; then \ - LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/$(TARGET_BUILD)/lib/ $(MAKE) $(NJOBS) -C $(TARGET_BUILD) check-lldb || true; \ + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ $(MAKE) $(NJOBS) -C $(TARGET_BUILD) check-lldb || true; \ fi # remove the workaround rm $(CURDIR)/$(TARGET_BUILD)/lib/python*/*-packages/_lldb.so From 87e77fcbba6858d0d842b984f07373a5a3517416 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 28 Mar 2021 10:17:30 +0200 Subject: [PATCH 13/38] display the LD_LIB_PATH --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index fd9f63d4..554d901b 100755 --- a/debian/rules +++ b/debian/rules @@ -304,6 +304,7 @@ preconfigure: @echo "DISTRO=$(DISTRO)" @echo "GCC_VERSION=$(GCC_VERSION)" @echo 'PROJECTS=$(PROJECTS_LIST)' + @echo 'LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)' for f in debian/*.in; do \ f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ From 1d59ad582c3b6941b8e834c82d44382007bb06c8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 28 Mar 2021 10:20:27 +0200 Subject: [PATCH 14/38] display CMAKE --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 554d901b..03b7641d 100755 --- a/debian/rules +++ b/debian/rules @@ -305,6 +305,7 @@ preconfigure: @echo "GCC_VERSION=$(GCC_VERSION)" @echo 'PROJECTS=$(PROJECTS_LIST)' @echo 'LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)' + @echo 'CMAKE_BIN=$(CMAKE_BIN)' for f in debian/*.in; do \ f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ From cf4794456888dc99e4963c276bcb92042709ad3e Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 19 Sep 2021 18:27:58 +0200 Subject: [PATCH 15/38] fix the typo for real --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e21c9e16..896ae05d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -113,7 +113,7 @@ llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium llvm-toolchain-12 (1:12.0.1-1) unstable; urgency=medium - * New uptsream release + * New upstream release -- Sylvestre Ledru Fri, 09 Jul 2021 09:13:12 +0200 From b44d95a67a2e21e28dfd92555cbf2576dab579b0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 24 Sep 2021 12:20:47 +0200 Subject: [PATCH 16/38] remove dup declaration on -DLIBUNWIND_USE_COMPILER_RT=ON --- debian/rules | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/rules b/debian/rules index cf251c90..b5f2a9d4 100755 --- a/debian/rules +++ b/debian/rules @@ -435,7 +435,6 @@ 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 \ $(CMAKE_EXTRA) \ $(Z3_FLAG) \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR;M68k" \ From 343bd8f5adb0d5b84c4319591a0e5eac1fbb129c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 24 Sep 2021 12:48:56 +0200 Subject: [PATCH 17/38] =?UTF-8?q?bump=20autopkgtest=20cmake=20version=20(C?= =?UTF-8?q?loses:=20#994501)=20Thanks=20to=20Timo=20R=C3=B6hling=20for=20t?= =?UTF-8?q?he=20patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 ++ debian/tests/cmake-test | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e5e753c5..5f05bd59 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ llvm-toolchain-9 (1:9.0.1-17) unstable; urgency=medium * Remove an old breaks/replaces for 9 which was causing some issues on Debian buster. Thanks to Julien Wajsberg for the bug report + * bump autopkgtest cmake version (Closes: #994501) + Thanks to Timo Röhling for the patch -- Sylvestre Ledru Mon, 08 Mar 2021 12:05:07 +0100 diff --git a/debian/tests/cmake-test b/debian/tests/cmake-test index 4e774f1f..c47c36e5 100755 --- a/debian/tests/cmake-test +++ b/debian/tests/cmake-test @@ -16,7 +16,7 @@ fi cd "$AUTOPKGTEST_TMP" cat < CMakeLists.txt -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.7) project(cmake-test) find_package(LLVM 9.0.0 REQUIRED COMPONENTS From 678e90d18ceb211779af6bee42fbd55b57ae1fe1 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 24 Sep 2021 12:50:29 +0200 Subject: [PATCH 18/38] =?UTF-8?q?bump=20autopkgtest=20cmake=20version=20(C?= =?UTF-8?q?loses:=20#994501)=20Thanks=20to=20Timo=20R=C3=B6hling=20for=20t?= =?UTF-8?q?he=20patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 ++ debian/tests/cmake-test | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 299c409a..e6a9ee5e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ llvm-toolchain-11 (1:11.1.0-1~exp3) UNRELEASED; urgency=medium * Cherry-pick upstream commit to fix a libgl1-mesa-dri texture failure. (Closes: #989545) + * bump autopkgtest cmake version (Closes: #994501) + Thanks to Timo Röhling for the patch -- Gianfranco Costamagna Wed, 01 Sep 2021 12:24:34 +0200 diff --git a/debian/tests/cmake-test b/debian/tests/cmake-test index c3dcc504..c73feead 100755 --- a/debian/tests/cmake-test +++ b/debian/tests/cmake-test @@ -16,7 +16,7 @@ fi cd "$AUTOPKGTEST_TMP" cat < CMakeLists.txt -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.7) project(cmake-test) find_package(LLVM 11.0.0 REQUIRED COMPONENTS From 551c7a31533d011a8b262945e79119b54542ce52 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 24 Sep 2021 12:55:22 +0200 Subject: [PATCH 19/38] upload to unstable --- debian/changelog | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index e6a9ee5e..09815cd2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,15 @@ -llvm-toolchain-11 (1:11.1.0-1~exp3) UNRELEASED; urgency=medium +llvm-toolchain-11 (1:11.1.0-1) unstable; urgency=medium - * Cherry-pick upstream commit to fix a libgl1-mesa-dri texture failure. - (Closes: #989545) + [ Sylvestre Ledru ] + * Upload to unstable * bump autopkgtest cmake version (Closes: #994501) Thanks to Timo Röhling for the patch - -- Gianfranco Costamagna Wed, 01 Sep 2021 12:24:34 +0200 + [ Gianfranco Costamagna ] + * Cherry-pick upstream commit to fix a libgl1-mesa-dri texture failure. + (Closes: #989545) + + -- Sylvestre Ledru Fri, 24 Sep 2021 12:54:55 +0200 llvm-toolchain-11 (1:11.1.0-1~exp2) experimental; urgency=medium From a9878e3505817a59cd5393aca1227e8f83a391a3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Sep 2021 09:41:21 +0200 Subject: [PATCH 20/38] New testing release --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1b689d4f..3059e18a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -llvm-toolchain-13 (1:13.0.0~+rc3-2) unstable; urgency=medium +llvm-toolchain-13 (1:13.0.0~+rc4-1) unstable; urgency=medium + * New testing release * Ship clang-repl See https://reviews.llvm.org/D106813 * Replace make by ninja for the build process From e6c9836c47c9b8f472c2669c159d3eef5b648511 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Sep 2021 16:00:47 +0200 Subject: [PATCH 21/38] cherry pick 68d5235cb58f988c71b403334cd9482d663841ab to build with newer version of the kernel --- debian/changelog | 4 +- debian/patches/remove-cyclades.diff | 74 +++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 debian/patches/remove-cyclades.diff diff --git a/debian/changelog b/debian/changelog index 5f05bd59..fec05f76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,10 @@ llvm-toolchain-9 (1:9.0.1-17) unstable; urgency=medium for the bug report * bump autopkgtest cmake version (Closes: #994501) Thanks to Timo Röhling for the patch + * cherry pick 68d5235cb58f988c71b403334cd9482d663841ab to build + with newer version of the kernel - -- Sylvestre Ledru Mon, 08 Mar 2021 12:05:07 +0100 + -- Sylvestre Ledru Sat, 25 Sep 2021 16:00:36 +0200 llvm-toolchain-9 (1:9.0.1-16) unstable; urgency=medium diff --git a/debian/patches/remove-cyclades.diff b/debian/patches/remove-cyclades.diff new file mode 100644 index 00000000..3d642f6b --- /dev/null +++ b/debian/patches/remove-cyclades.diff @@ -0,0 +1,74 @@ +commit 68d5235cb58f988c71b403334cd9482d663841ab +Author: Tamar Christina +Date: Thu May 20 18:55:11 2021 +0100 + + libsanitizer: Remove cyclades inclusion in sanitizer + + The Linux kernel has removed the interface to cyclades from + the latest kernel headers[1] due to them being orphaned for the + past 13 years. + + libsanitizer uses this header when compiling against glibc, but + glibcs itself doesn't seem to have any references to cyclades. + + Further more it seems that the driver is broken in the kernel and + the firmware doesn't seem to be available anymore. + + As such since this is breaking the build of libsanitizer (and so the + GCC bootstrap[2]) I propose to remove this. + + [1] https://lkml.org/lkml/2021/3/2/153 + [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379 + + Reviewed By: eugenis + + Differential Revision: https://reviews.llvm.org/D102059 + +Index: llvm-toolchain-9-9.0.1/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +=================================================================== +--- llvm-toolchain-9-9.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc ++++ llvm-toolchain-9-9.0.1/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +@@ -366,15 +366,6 @@ static void ioctl_table_fill() { + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE +- _(CYGETDEFTHRESH, WRITE, sizeof(int)); +- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); +- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); +- _(CYGETTHRESH, WRITE, sizeof(int)); +- _(CYGETTIMEOUT, WRITE, sizeof(int)); +- _(CYSETDEFTHRESH, NONE, 0); +- _(CYSETDEFTIMEOUT, NONE, 0); +- _(CYSETTHRESH, NONE, 0); +- _(CYSETTIMEOUT, NONE, 0); + _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); + _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); + _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); +Index: llvm-toolchain-9-9.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +=================================================================== +--- llvm-toolchain-9-9.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ llvm-toolchain-9-9.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -969,7 +969,6 @@ struct __sanitizer_cookie_io_functions_t + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + extern unsigned struct_ax25_parms_struct_sz; +- extern unsigned struct_cyclades_monitor_sz; + extern unsigned struct_input_keymap_entry_sz; + extern unsigned struct_ipx_config_data_sz; + extern unsigned struct_kbdiacrs_sz; +@@ -1314,15 +1313,6 @@ struct __sanitizer_cookie_io_functions_t + #endif // SANITIZER_LINUX + + #if SANITIZER_LINUX && !SANITIZER_ANDROID +- extern unsigned IOCTL_CYGETDEFTHRESH; +- extern unsigned IOCTL_CYGETDEFTIMEOUT; +- extern unsigned IOCTL_CYGETMON; +- extern unsigned IOCTL_CYGETTHRESH; +- extern unsigned IOCTL_CYGETTIMEOUT; +- extern unsigned IOCTL_CYSETDEFTHRESH; +- extern unsigned IOCTL_CYSETDEFTIMEOUT; +- extern unsigned IOCTL_CYSETTHRESH; +- extern unsigned IOCTL_CYSETTIMEOUT; + extern unsigned IOCTL_EQL_EMANCIPATE; + extern unsigned IOCTL_EQL_ENSLAVE; + extern unsigned IOCTL_EQL_GETMASTRCFG; diff --git a/debian/patches/series b/debian/patches/series index c688aa14..6384406e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -157,3 +157,4 @@ f8e146f3430de3a6cd904f3f3f7aa1bfaefee14c.patch # bug 974779 llvm9-D71443-PPC-MC-redef-symbol.patch llvm-9.0-D78196.patch +remove-cyclades.diff From dafef55b0b03894e1a57f5b51b77cc93cbbca036 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Sep 2021 16:33:30 +0200 Subject: [PATCH 22/38] add verbose options to ninja elsewere --- debian/rules | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/rules b/debian/rules index b5f2a9d4..60791e4a 100755 --- a/debian/rules +++ b/debian/rules @@ -590,13 +590,13 @@ build_doc: cd $(CURDIR)/llvm/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man cd $(CURDIR)/clang/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man -(if test "$(OCAML_ENABLE)" = yes; then \ - ninja -C "$(TARGET_BUILD_STAGE2)" ocaml_doc; \ + ninja -C "$(TARGET_BUILD_STAGE2)" ocaml_doc $(VERBOSE); \ fi) - ninja -C $(TARGET_BUILD_STAGE2) docs-llvm-html docs-clang-html docs-clang-tools-html docs-clang-tools-man docs-clang-man docs-llvm-man + ninja -C $(TARGET_BUILD_STAGE2) docs-llvm-html docs-clang-html docs-clang-tools-html docs-clang-tools-man docs-clang-man docs-llvm-man $(VERBOSE) ifeq (${POLLY_ENABLE},yes) - ninja -C $(TARGET_BUILD_STAGE2) docs-polly-html docs-polly-man + ninja -C $(TARGET_BUILD_STAGE2) docs-polly-html docs-polly-man $(VERBOSE) endif # Rename manpages @@ -715,9 +715,9 @@ endif rm -rf $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/__pycache__/ \ $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/*/__pycache__/ - DESTDIR=$(DEB_INST) ninja -C libcxxabi/build install - DESTDIR=$(DEB_INST) ninja -C libcxx/build install - DESTDIR=$(DEB_INST) ninja -C libclc/build install + DESTDIR=$(DEB_INST) ninja -C libcxxabi/build install $(VERBOSE) + DESTDIR=$(DEB_INST) ninja -C libcxx/build install $(VERBOSE) + DESTDIR=$(DEB_INST) ninja -C libclc/build install $(VERBOSE) # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ From 91820145ac2b104e93c7e1ac6b30a38efa5eec44 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Sep 2021 21:33:02 +0200 Subject: [PATCH 23/38] adjust the code with cyclades removal --- debian/patches/remove-cyclades.diff | 110 ++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 111 insertions(+) create mode 100644 debian/patches/remove-cyclades.diff diff --git a/debian/patches/remove-cyclades.diff b/debian/patches/remove-cyclades.diff new file mode 100644 index 00000000..a97f7913 --- /dev/null +++ b/debian/patches/remove-cyclades.diff @@ -0,0 +1,110 @@ +commit 68d5235cb58f988c71b403334cd9482d663841ab +Author: Tamar Christina +Date: Thu May 20 18:55:11 2021 +0100 + + libsanitizer: Remove cyclades inclusion in sanitizer + + The Linux kernel has removed the interface to cyclades from + the latest kernel headers[1] due to them being orphaned for the + past 13 years. + + libsanitizer uses this header when compiling against glibc, but + glibcs itself doesn't seem to have any references to cyclades. + + Further more it seems that the driver is broken in the kernel and + the firmware doesn't seem to be available anymore. + + As such since this is breaking the build of libsanitizer (and so the + GCC bootstrap[2]) I propose to remove this. + + [1] https://lkml.org/lkml/2021/3/2/153 + [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379 + + Reviewed By: eugenis + + Differential Revision: https://reviews.llvm.org/D102059 + +Index: llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc ++++ llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +@@ -366,15 +366,6 @@ static void ioctl_table_fill() { + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE +- _(CYGETDEFTHRESH, WRITE, sizeof(int)); +- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); +- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); +- _(CYGETTHRESH, WRITE, sizeof(int)); +- _(CYGETTIMEOUT, WRITE, sizeof(int)); +- _(CYSETDEFTHRESH, NONE, 0); +- _(CYSETDEFTIMEOUT, NONE, 0); +- _(CYSETTHRESH, NONE, 0); +- _(CYSETTIMEOUT, NONE, 0); + _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); + _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); + _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); +Index: llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -130,7 +130,6 @@ typedef struct user_fpregs elf_fpregset_ + # include + #endif + #include +-#include + #include + #include + #include +@@ -444,7 +443,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); +- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); + #if EV_VERSION > (0x010000) + unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); + #else +@@ -810,15 +808,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El + #endif // SANITIZER_LINUX + + #if SANITIZER_LINUX && !SANITIZER_ANDROID +- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; +- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; +- unsigned IOCTL_CYGETMON = CYGETMON; +- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; +- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; +- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; +- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; +- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; +- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; + unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; + unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; + unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; +Index: llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -981,7 +981,6 @@ extern unsigned struct_vt_mode_sz; + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + extern unsigned struct_ax25_parms_struct_sz; +-extern unsigned struct_cyclades_monitor_sz; + extern unsigned struct_input_keymap_entry_sz; + extern unsigned struct_ipx_config_data_sz; + extern unsigned struct_kbdiacrs_sz; +@@ -1326,15 +1325,6 @@ extern unsigned IOCTL_VT_WAITACTIVE; + #endif // SANITIZER_LINUX + + #if SANITIZER_LINUX && !SANITIZER_ANDROID +-extern unsigned IOCTL_CYGETDEFTHRESH; +-extern unsigned IOCTL_CYGETDEFTIMEOUT; +-extern unsigned IOCTL_CYGETMON; +-extern unsigned IOCTL_CYGETTHRESH; +-extern unsigned IOCTL_CYGETTIMEOUT; +-extern unsigned IOCTL_CYSETDEFTHRESH; +-extern unsigned IOCTL_CYSETDEFTIMEOUT; +-extern unsigned IOCTL_CYSETTHRESH; +-extern unsigned IOCTL_CYSETTIMEOUT; + extern unsigned IOCTL_EQL_EMANCIPATE; + extern unsigned IOCTL_EQL_ENSLAVE; + extern unsigned IOCTL_EQL_GETMASTRCFG; diff --git a/debian/patches/series b/debian/patches/series index 81267735..a436aca5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -146,3 +146,4 @@ scan-build-py-fix-analyze-path.diff D91833-bpftrace-fix-code-gen.diff scan-build-py-fix-default-bin.diff mesa-texture-failure.patch +remove-cyclades.diff From 18c22b8e26135ea95d34d644b13139f51603b0fa Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 26 Sep 2021 21:28:32 +0200 Subject: [PATCH 24/38] relax the cmake dependency --- debian/tests/cmake-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/cmake-test b/debian/tests/cmake-test index c73feead..5c4bddca 100755 --- a/debian/tests/cmake-test +++ b/debian/tests/cmake-test @@ -18,7 +18,7 @@ cd "$AUTOPKGTEST_TMP" cat < CMakeLists.txt cmake_minimum_required(VERSION 3.7) project(cmake-test) -find_package(LLVM 11.0.0 REQUIRED +find_package(LLVM 11 REQUIRED COMPONENTS Analysis BitReader From 2de3bcbf2b7c7fff051f796c20b4a121250c3b8b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 26 Sep 2021 21:40:17 +0200 Subject: [PATCH 25/38] adjust the cmake version test --- debian/tests/cmake-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/cmake-test b/debian/tests/cmake-test index 5c4bddca..f9869f4c 100755 --- a/debian/tests/cmake-test +++ b/debian/tests/cmake-test @@ -18,7 +18,7 @@ cd "$AUTOPKGTEST_TMP" cat < CMakeLists.txt cmake_minimum_required(VERSION 3.7) project(cmake-test) -find_package(LLVM 11 REQUIRED +find_package(LLVM 11.1 REQUIRED COMPONENTS Analysis BitReader From d4cc4b9682d1c6cd9806eddde46cf0530d00c1ad Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 14:25:36 +0200 Subject: [PATCH 26/38] Bump minimum cmake version in qualify-clang.sh test too. Fix minimum cmake version now set to 11 --- debian/qualify-clang.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 82389f68..815b7452 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -84,7 +84,7 @@ fi rm -rf cmaketest && mkdir cmaketest cat > cmaketest/CMakeLists.txt < cmaketest/CMakeLists.txt < cmaketest/CMakeLists.txt < cmaketest/CMakeLists.txt < Date: Mon, 27 Sep 2021 15:04:12 +0200 Subject: [PATCH 27/38] From Andreas Beckmann clang-9: Drop Recommends: libomp-9-dev which is not co-installable with libomp-11-dev (and libomp-dev) for smoother upgrades of libomp-dev from buster to bullseye. (Closes: #990452) --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 58b2302b..7b92a6a6 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, ${dep:devlibs-objc}, libclang-common-9-dev (= ${binary:Version}), libclang-cpp9 (= ${binary:Version}), libc6-dev, binutils Provides: c-compiler, objc-compiler, c++-compiler -Recommends: llvm-9-dev, python3, libomp-9-dev +Recommends: llvm-9-dev, python3, +# libomp-9-dev Suggests: clang-9-doc Description: C, C++ and Objective-C compiler Clang project is a C, C++, Objective C and Objective C++ front-end From 9e31f247fc4672b22b72133b75173698f7d1abf4 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:04:49 +0200 Subject: [PATCH 28/38] bump minimum cmake version on qualify-clang.sh too --- debian/qualify-clang.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index f89becd9..3b8065d2 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -935,7 +935,7 @@ fi rm -rf cmaketest && mkdir cmaketest cat > cmaketest/CMakeLists.txt < cmaketest/CMakeLists.txt < Date: Mon, 27 Sep 2021 15:05:11 +0200 Subject: [PATCH 29/38] simplify cmake test without minor version --- debian/tests/cmake-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/cmake-test b/debian/tests/cmake-test index c47c36e5..09978e6f 100755 --- a/debian/tests/cmake-test +++ b/debian/tests/cmake-test @@ -18,7 +18,7 @@ cd "$AUTOPKGTEST_TMP" cat < CMakeLists.txt cmake_minimum_required(VERSION 3.7) project(cmake-test) -find_package(LLVM 9.0.0 REQUIRED +find_package(LLVM 9 REQUIRED COMPONENTS Analysis BitReader From 7bd8664808299d26994f8e06dfeed9a9580e9ea0 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:06:24 +0200 Subject: [PATCH 30/38] Reupload to sid --- debian/changelog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index fec05f76..da2c8422 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +llvm-toolchain-9 (1:9.0.1-18) unstable; urgency=medium + + [ Gianfranco Costamagna ] + * Cherry-pick nmu again. (version 16.1) + * bump minimum cmake version on qualify-clang.sh too + * simplify cmake test without minor version + [ Andreas Beckmann ] + * clang-9: Drop Recommends: libomp-9-dev which is not co-installable with + libomp-11-dev (and libomp-dev) for smoother upgrades of libomp-dev from + buster to bullseye. (Closes: #990452) + + -- Gianfranco Costamagna Mon, 27 Sep 2021 15:02:13 +0200 + llvm-toolchain-9 (1:9.0.1-17) unstable; urgency=medium * Remove an old breaks/replaces for 9 which was causing From f0f580b0b513e8c12c02f9d31bf9eb569d417fde Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:32:14 +0200 Subject: [PATCH 31/38] Add new llvm-11-linker-tools --- debian/control | 17 ++++++++++++++++- debian/llvm-X.Y-dev.install.in | 3 +-- debian/llvm-X.Y-linker-tools.install.in | 4 ++++ debian/rules | 13 ++++++++++++- 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 debian/llvm-X.Y-linker-tools.install.in diff --git a/debian/control b/debian/control index ecd71eb6..ef4be0c2 100644 --- a/debian/control +++ b/debian/control @@ -32,6 +32,7 @@ Package: clang-11 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, ${dep:devlibs-objc}, libclang-common-11-dev (= ${binary:Version}), + llvm-11-linker-tools (= ${binary:Version}), libclang1-11 (= ${binary:Version}), libc6-dev, binutils Provides: c-compiler, objc-compiler, c++-compiler Recommends: llvm-11-dev, python3, libomp-11-dev @@ -282,10 +283,24 @@ Description: Modular compiler and toolchain technologies, runtime library . This package contains the LLVM runtime library. +Package: llvm-11-linker-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Breaks: llvm-11-dev (<< 1:11.1.0-2) +Replaces: llvm-11-dev (<< 1:11.1.0-2) +Description: Modular compiler and toolchain technologies + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + This package contains the LLVMgold and LLVMPolly linker plugins. + Package: llvm-11 Architecture: any Suggests: llvm-11-doc -Depends: llvm-11-runtime (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Depends: llvm-11-runtime (= ${binary:Version}), + llvm-11-linker-tools (= ${binary:Version}), + ${shlibs:Depends}, ${misc:Depends} Recommends: llvm-11-dev Description: Modular compiler and toolchain technologies LLVM is a collection of libraries and tools that make it easy to build diff --git a/debian/llvm-X.Y-dev.install.in b/debian/llvm-X.Y-dev.install.in index a6acd028..aab9970a 100644 --- a/debian/llvm-X.Y-dev.install.in +++ b/debian/llvm-X.Y-dev.install.in @@ -2,10 +2,9 @@ usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM*.a #usr/lib/llvm-@LLVM_VERSION@/lib/libllvm*.a -[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/LLVM*.so usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM.so usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@*.so -usr/lib/llvm-@LLVM_VERSION@/lib/libLTO.* +usr/lib/llvm-@LLVM_VERSION@/lib/libLTO.so usr/lib/llvm-@LLVM_VERSION@/lib/libRemarks.* usr/lib/llvm-@LLVM_VERSION@/include/llvm/ usr/include/llvm-@LLVM_VERSION@/ usr/lib/llvm-@LLVM_VERSION@/include/llvm-c/ usr/include/llvm-c-@LLVM_VERSION@/ diff --git a/debian/llvm-X.Y-linker-tools.install.in b/debian/llvm-X.Y-linker-tools.install.in new file mode 100644 index 00000000..3aeaab5c --- /dev/null +++ b/debian/llvm-X.Y-linker-tools.install.in @@ -0,0 +1,4 @@ +#!/usr/bin/dh-exec + +usr/lib/llvm-@LLVM_VERSION@/lib/libLTO.so.@LLVM_VERSION@ +[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/LLVM*.so diff --git a/debian/rules b/debian/rules index 23bc0146..5ef8985c 100755 --- a/debian/rules +++ b/debian/rules @@ -325,7 +325,12 @@ preconfigure: done # Make install file executable for dh-exec - chmod +x debian/llvm-$(LLVM_VERSION)-dev.install debian/libclang-common-$(LLVM_VERSION)-dev.install debian/clang-tools-$(LLVM_VERSION).install debian/libomp-$(LLVM_VERSION)-dev.install + chmod +x \ + debian/clang-tools-$(LLVM_VERSION).install \ + debian/libclang-common-$(LLVM_VERSION)-dev.install \ + debian/libomp-$(LLVM_VERSION)-dev.install \ + debian/llvm-$(LLVM_VERSION)-dev.install \ + debian/llvm-$(LLVM_VERSION)-linker-tools.install # Override this two targets. They are trying to manage the .in conversion for me override_dh_ocamlinit: @@ -877,5 +882,11 @@ override_dh_auto_clean: if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \ mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \ fi + for f in debian/*.in; do \ + f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ + rm -f $$f2; \ + done + : # for some reason, the docs are written to debian/usr and debian/man ... + rm -rf debian/usr debian/man .PHONY: override_dh_strip preconfigure debian-full-build debian-libfuzzer-build debian-libcxx-build debian-libcxxabi-build From 550cf436531323767f5737152136f3f5bb2ad10e Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:36:50 +0200 Subject: [PATCH 32/38] Don't require libclang-11-dev on cmake-test --- debian/tests/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/control b/debian/tests/control index 87201066..38411379 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -10,7 +10,7 @@ Depends: @, cmake, make, g++, libstdc++-10-dev Restrictions: allow-stderr Tests: cmake-test -Depends: gcc, build-essential, cmake, llvm-11-dev, libclang-common-11-dev +Depends: gcc, build-essential, cmake, llvm-11-dev Test-Command: python3 -c "import lldb; print(lldb.__file__); print(lldb)" Depends: python3-lldb-11 From eb01679b4a2f5135c383ede60348510fd48915c7 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:37:02 +0200 Subject: [PATCH 33/38] Use minimum version for cmake-test --- debian/tests/cmake-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/cmake-test b/debian/tests/cmake-test index c73feead..5c4bddca 100755 --- a/debian/tests/cmake-test +++ b/debian/tests/cmake-test @@ -18,7 +18,7 @@ cd "$AUTOPKGTEST_TMP" cat < CMakeLists.txt cmake_minimum_required(VERSION 3.7) project(cmake-test) -find_package(LLVM 11.0.0 REQUIRED +find_package(LLVM 11 REQUIRED COMPONENTS Analysis BitReader From 8a5a9a4172fe34f3bd92334e112bedcdd6956435 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:37:26 +0200 Subject: [PATCH 34/38] Add two patches from ubuntu to fix lto and gcc-11 build failures --- debian/patches/D99501-ignore-lto-auto.diff | 31 +++++++++++++++++++ .../patches/fix-missing-include-limit.patch | 26 ++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 59 insertions(+) create mode 100644 debian/patches/D99501-ignore-lto-auto.diff create mode 100644 debian/patches/fix-missing-include-limit.patch diff --git a/debian/patches/D99501-ignore-lto-auto.diff b/debian/patches/D99501-ignore-lto-auto.diff new file mode 100644 index 00000000..0c09bcc2 --- /dev/null +++ b/debian/patches/D99501-ignore-lto-auto.diff @@ -0,0 +1,31 @@ +Index: llvm-toolchain-12-12.0.0~++rc3/clang/include/clang/Driver/Driver.h +=================================================================== +--- llvm-toolchain-12-12.0.0~++rc3.orig/clang/include/clang/Driver/Driver.h ++++ llvm-toolchain-12-12.0.0~++rc3/clang/include/clang/Driver/Driver.h +@@ -51,7 +51,8 @@ enum LTOKind { + LTOK_None, + LTOK_Full, + LTOK_Thin, +- LTOK_Unknown ++ LTOK_Unknown, ++ LTOK_Ignored + }; + + /// Driver - Encapsulate logic for constructing compilation processes +Index: llvm-toolchain-12-12.0.0~++rc3/clang/lib/Driver/Driver.cpp +=================================================================== +--- llvm-toolchain-12-12.0.0~++rc3.orig/clang/lib/Driver/Driver.cpp ++++ llvm-toolchain-12-12.0.0~++rc3/clang/lib/Driver/Driver.cpp +@@ -608,9 +608,12 @@ void Driver::setLTOMode(const llvm::opt: + LTOMode = llvm::StringSwitch(LTOName) + .Case("full", LTOK_Full) + .Case("thin", LTOK_Thin) ++ .Case("auto", LTOK_Ignored) ++ .Case("jobserver", LTOK_Ignored) + .Default(LTOK_Unknown); + + if (LTOMode == LTOK_Unknown) { ++ // FIXME: check if argument is a number, then ignore, or handle it + assert(A); + Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() + << A->getValue(); diff --git a/debian/patches/fix-missing-include-limit.patch b/debian/patches/fix-missing-include-limit.patch new file mode 100644 index 00000000..37242b2a --- /dev/null +++ b/debian/patches/fix-missing-include-limit.patch @@ -0,0 +1,26 @@ +From b498303066a63a203d24f739b2d2e0e56dca70d1 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Tue, 10 Nov 2020 14:55:25 +0100 +Subject: [PATCH] [nfc] Fix missing include + +Origin: backport, https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-11/+bug/1939424 +Applied-Upstream: 12.0.0 +Reviewed-By: Sergio Durigan Junior + +--- + llvm/utils/benchmark/src/benchmark_register.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h +index 0705e219f2fa..4caa5ad4da07 100644 +--- a/llvm/utils/benchmark/src/benchmark_register.h ++++ b/llvm/utils/benchmark/src/benchmark_register.h +@@ -1,6 +1,7 @@ + #ifndef BENCHMARK_REGISTER_H + #define BENCHMARK_REGISTER_H + ++#include + #include + + #include "check.h" diff --git a/debian/patches/series b/debian/patches/series index a436aca5..82c1a119 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -147,3 +147,5 @@ D91833-bpftrace-fix-code-gen.diff scan-build-py-fix-default-bin.diff mesa-texture-failure.patch remove-cyclades.diff +D99501-ignore-lto-auto.diff +fix-missing-include-limit.patch From 6f5bd76f9be63c30d187250036964934d219ef71 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:37:26 +0200 Subject: [PATCH 35/38] Add two patches from ubuntu to fix lto and gcc-11 build failures --- debian/patches/D99501-ignore-lto-auto.diff | 31 +++++++++++++++++++ .../patches/fix-missing-include-limit.patch | 26 ++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 59 insertions(+) create mode 100644 debian/patches/D99501-ignore-lto-auto.diff create mode 100644 debian/patches/fix-missing-include-limit.patch diff --git a/debian/patches/D99501-ignore-lto-auto.diff b/debian/patches/D99501-ignore-lto-auto.diff new file mode 100644 index 00000000..0c09bcc2 --- /dev/null +++ b/debian/patches/D99501-ignore-lto-auto.diff @@ -0,0 +1,31 @@ +Index: llvm-toolchain-12-12.0.0~++rc3/clang/include/clang/Driver/Driver.h +=================================================================== +--- llvm-toolchain-12-12.0.0~++rc3.orig/clang/include/clang/Driver/Driver.h ++++ llvm-toolchain-12-12.0.0~++rc3/clang/include/clang/Driver/Driver.h +@@ -51,7 +51,8 @@ enum LTOKind { + LTOK_None, + LTOK_Full, + LTOK_Thin, +- LTOK_Unknown ++ LTOK_Unknown, ++ LTOK_Ignored + }; + + /// Driver - Encapsulate logic for constructing compilation processes +Index: llvm-toolchain-12-12.0.0~++rc3/clang/lib/Driver/Driver.cpp +=================================================================== +--- llvm-toolchain-12-12.0.0~++rc3.orig/clang/lib/Driver/Driver.cpp ++++ llvm-toolchain-12-12.0.0~++rc3/clang/lib/Driver/Driver.cpp +@@ -608,9 +608,12 @@ void Driver::setLTOMode(const llvm::opt: + LTOMode = llvm::StringSwitch(LTOName) + .Case("full", LTOK_Full) + .Case("thin", LTOK_Thin) ++ .Case("auto", LTOK_Ignored) ++ .Case("jobserver", LTOK_Ignored) + .Default(LTOK_Unknown); + + if (LTOMode == LTOK_Unknown) { ++ // FIXME: check if argument is a number, then ignore, or handle it + assert(A); + Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() + << A->getValue(); diff --git a/debian/patches/fix-missing-include-limit.patch b/debian/patches/fix-missing-include-limit.patch new file mode 100644 index 00000000..37242b2a --- /dev/null +++ b/debian/patches/fix-missing-include-limit.patch @@ -0,0 +1,26 @@ +From b498303066a63a203d24f739b2d2e0e56dca70d1 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Tue, 10 Nov 2020 14:55:25 +0100 +Subject: [PATCH] [nfc] Fix missing include + +Origin: backport, https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-11/+bug/1939424 +Applied-Upstream: 12.0.0 +Reviewed-By: Sergio Durigan Junior + +--- + llvm/utils/benchmark/src/benchmark_register.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h +index 0705e219f2fa..4caa5ad4da07 100644 +--- a/llvm/utils/benchmark/src/benchmark_register.h ++++ b/llvm/utils/benchmark/src/benchmark_register.h +@@ -1,6 +1,7 @@ + #ifndef BENCHMARK_REGISTER_H + #define BENCHMARK_REGISTER_H + ++#include + #include + + #include "check.h" diff --git a/debian/patches/series b/debian/patches/series index 6384406e..cb53c3fe 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -158,3 +158,5 @@ f8e146f3430de3a6cd904f3f3f7aa1bfaefee14c.patch llvm9-D71443-PPC-MC-redef-symbol.patch llvm-9.0-D78196.patch remove-cyclades.diff +D99501-ignore-lto-auto.diff +fix-missing-include-limit.patch From 35b9f7d3271290a502de9c01a73aa1a500bf7a25 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:39:31 +0200 Subject: [PATCH 36/38] Reupload to sid --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index da2c8422..50d55d9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-9 (1:9.0.1-19) unstable; urgency=medium + + * Add two patches from ubuntu to fix lto and gcc-11 build failures + + -- Gianfranco Costamagna Mon, 27 Sep 2021 15:39:19 +0200 + llvm-toolchain-9 (1:9.0.1-18) unstable; urgency=medium [ Gianfranco Costamagna ] From dadd6f29bd1e78e770ca0e8213b1ff52314d27d8 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:53:07 +0200 Subject: [PATCH 37/38] Update changelog --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index f07a244e..2b76d3fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +llvm-toolchain-11 (1:11.1.0-2) unstable; urgency=medium + + * Add two patches from ubuntu to fix lto and gcc-11 build failures + * Use minimum version for cmake-test + * Don't require libclang-11-dev on cmake-test + * Add new llvm-11-linker-tools (from Ubuntu) + * Merge new fixes from branch=9 + * clang-11: Drop Recommends: libomp-11-dev + + -- Gianfranco Costamagna Mon, 27 Sep 2021 15:50:46 +0200 + llvm-toolchain-11 (1:11.1.0-1) unstable; urgency=medium [ Sylvestre Ledru ] From 65282034bae91adf55cc6a1fb890f6ed4a4fc3f6 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 16:29:12 +0200 Subject: [PATCH 38/38] Fixup breaks/replaces --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 7586ddc0..951a6d09 100644 --- a/debian/control +++ b/debian/control @@ -287,8 +287,8 @@ Description: Modular compiler and toolchain technologies, runtime library Package: llvm-11-linker-tools Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Breaks: llvm-11-dev (<< 1:11.1.0-2) -Replaces: llvm-11-dev (<< 1:11.1.0-2) +Breaks: llvm-11-dev (<< 1:11.1.0-3) +Replaces: llvm-11-dev (<< 1:11.1.0-3) Description: Modular compiler and toolchain technologies LLVM is a collection of libraries and tools that make it easy to build compilers, optimizers, just-in-time code generators, and many other