From 2eee7fef59ab79c8447561118c70791dfd88922e Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 14 Oct 2022 23:35:55 +0200 Subject: [PATCH 01/89] try to use sccache if available --- debian/rules | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/rules b/debian/rules index 4ebc5495..98da633a 100755 --- a/debian/rules +++ b/debian/rules @@ -420,6 +420,12 @@ ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/ endif +# if sccache is installed in the chroot, use it +ifeq ($(shell test -e ~/sccache && echo -n yes),yes) + export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json + STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache +endif + GENERATOR=Ninja # enables cmake build targets like stage2-[target_name] From 3e61b0ec165eed3665444d218d4c0024111be28b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 15 Oct 2022 10:05:20 +0200 Subject: [PATCH 02/89] expect sccahe in /tmp/ --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 98da633a..9a85e607 100755 --- a/debian/rules +++ b/debian/rules @@ -421,9 +421,9 @@ ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) endif # if sccache is installed in the chroot, use it -ifeq ($(shell test -e ~/sccache && echo -n yes),yes) +ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json - STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif GENERATOR=Ninja From 3bef73c9ad72b953e7f656eefcb5b9516ffbae91 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 15 Oct 2022 10:30:28 +0200 Subject: [PATCH 03/89] provide SCCACHE_GCS_BUCKET --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 9a85e607..d853dad2 100755 --- a/debian/rules +++ b/debian/rules @@ -423,6 +423,7 @@ endif # if sccache is installed in the chroot, use it ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json + export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif From d33bd3b8aa53930595f40fdf2638531875d241eb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 15 Oct 2022 10:43:51 +0200 Subject: [PATCH 04/89] set SCCACHE_GCS_RW_MODE to READ_WRITE --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index d853dad2..07319b5d 100755 --- a/debian/rules +++ b/debian/rules @@ -424,6 +424,7 @@ endif ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache + export SCCACHE_GCS_RW_MODE=READ_WRITE STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif From 24275bf8d9d44c9da10a215acf7743b42de79719 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 15 Oct 2022 11:37:30 +0200 Subject: [PATCH 05/89] if we used sccache, show the stats --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index 07319b5d..ddadc9ad 100755 --- a/debian/rules +++ b/debian/rules @@ -648,6 +648,11 @@ debian-full-build: LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2 +# If we used sccache, shows stats + if test -f /tmp/sccache; then \ + /tmp/sccache --show-stats; \ + fi + # Check the stage 2 build worked if ! readelf --string-dump .comment $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \ echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \ From b157b0181f058b1196e44bc08bd455afbe89dbc8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 15 Oct 2022 23:32:55 +0200 Subject: [PATCH 06/89] more debug info --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index ddadc9ad..ce05527b 100755 --- a/debian/rules +++ b/debian/rules @@ -425,6 +425,8 @@ ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache export SCCACHE_GCS_RW_MODE=READ_WRITE + export SCCACHE_LOG=sccache=debug + export SCCACHE_ERROR_LOG=/tmp/sccache.log STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif @@ -651,6 +653,7 @@ debian-full-build: # If we used sccache, shows stats if test -f /tmp/sccache; then \ /tmp/sccache --show-stats; \ + cat /tmp/sccache.log; \ fi # Check the stage 2 build worked From 3679d9c59cba94f226b660a47913e6cb28a1e48d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 01:55:23 +0200 Subject: [PATCH 07/89] sccache: create an empty config file to avoid flooding the log with this --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rules b/debian/rules index ce05527b..ff4e3d09 100755 --- a/debian/rules +++ b/debian/rules @@ -427,6 +427,8 @@ ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_GCS_RW_MODE=READ_WRITE export SCCACHE_LOG=sccache=debug export SCCACHE_ERROR_LOG=/tmp/sccache.log + mkdir -p ~/.config/sccache/ + touch ~/.config/sccache/config STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif From 0b12f4f2ac7e1473984a478207c818fcb4315544 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 10:49:04 +0200 Subject: [PATCH 08/89] fix the declaration --- debian/rules | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index ff4e3d09..f031abfc 100755 --- a/debian/rules +++ b/debian/rules @@ -427,8 +427,6 @@ ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_GCS_RW_MODE=READ_WRITE export SCCACHE_LOG=sccache=debug export SCCACHE_ERROR_LOG=/tmp/sccache.log - mkdir -p ~/.config/sccache/ - touch ~/.config/sccache/config STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif @@ -545,6 +543,12 @@ override_dh_auto_configure: preconfigure --xml-option append_arg:"replace/llvm::AlignOf::Alignment/(llvm::AlignOf::Alignment)"; \ fi) +# If we use sccache, create temporary conf file + if test -f /tmp/sccache; then \ + mkdir -p ~/.config/sccache/; \ + touch ~/.config/sccache/config; \ + fi + # Fails with No target "unwind_static" # -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF \ From 8ce637ac3395efce1a103a647d3dfde065257bf2 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 11:00:18 +0200 Subject: [PATCH 09/89] remove wa --- debian/rules | 6 ------ 1 file changed, 6 deletions(-) diff --git a/debian/rules b/debian/rules index f031abfc..ce05527b 100755 --- a/debian/rules +++ b/debian/rules @@ -543,12 +543,6 @@ override_dh_auto_configure: preconfigure --xml-option append_arg:"replace/llvm::AlignOf::Alignment/(llvm::AlignOf::Alignment)"; \ fi) -# If we use sccache, create temporary conf file - if test -f /tmp/sccache; then \ - mkdir -p ~/.config/sccache/; \ - touch ~/.config/sccache/config; \ - fi - # Fails with No target "unwind_static" # -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF \ From 0e6b7142cf22e260135a2baa831982a7b00c4a59 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 11:08:18 +0200 Subject: [PATCH 10/89] cat sccache in case of error --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index ce05527b..9cc4814e 100755 --- a/debian/rules +++ b/debian/rules @@ -648,7 +648,7 @@ debian-full-build: echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ - VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2 + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat /tmp/sccache.log # If we used sccache, shows stats if test -f /tmp/sccache; then \ From 745291f0b9212f94fddcf207274d4cae4d349d45 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 16:15:50 +0200 Subject: [PATCH 11/89] only do it for bullseye --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rules b/debian/rules index 9cc4814e..641b7aa7 100755 --- a/debian/rules +++ b/debian/rules @@ -422,6 +422,7 @@ endif # if sccache is installed in the chroot, use it ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) +ifneq (,$(filter $(DISTRO),bullseye)) export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache export SCCACHE_GCS_RW_MODE=READ_WRITE @@ -429,6 +430,7 @@ ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) export SCCACHE_ERROR_LOG=/tmp/sccache.log STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache endif +endif GENERATOR=Ninja From d4613f2d910b5010190b41c35cd44c8aa50577b6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 17:36:14 +0200 Subject: [PATCH 12/89] update of the sccache path --- debian/rules | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/debian/rules b/debian/rules index 641b7aa7..b2284c8e 100755 --- a/debian/rules +++ b/debian/rules @@ -421,14 +421,14 @@ ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) endif # if sccache is installed in the chroot, use it -ifeq ($(shell test -e /tmp/sccache && echo -n yes),yes) +ifeq ($(shell test -e /tmp/sccache/sccache && echo -n yes),yes) ifneq (,$(filter $(DISTRO),bullseye)) - export SCCACHE_GCS_KEY_PATH=secret-gcp-storage.json + export SCCACHE_GCS_KEY_PATH=/tmp/sccache/secret-gcp-storage.json export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache export SCCACHE_GCS_RW_MODE=READ_WRITE export SCCACHE_LOG=sccache=debug - export SCCACHE_ERROR_LOG=/tmp/sccache.log - STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache + export SCCACHE_ERROR_LOG=/tmp/sccache/sccache.log + STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache/sccache endif endif @@ -647,15 +647,19 @@ override_dh_auto_configure: preconfigure VERBOSE=-v debian-full-build: + if test ! -f /tmp/sccache/secret-gcp-storage.json -a -f /tmp/sccache/sccache; then \ + echo "Could not find /tmp/sccache/secret-gcp-storage.json"; \ + fi + echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ - VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat /tmp/sccache.log + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat /tmp/sccache/sccache.log # If we used sccache, shows stats - if test -f /tmp/sccache; then \ - /tmp/sccache --show-stats; \ - cat /tmp/sccache.log; \ + if test -f /tmp/sccache/sccache; then \ + /tmp/sccache/sccache --show-stats; \ + cat /tmp/sccache/sccache.log; \ fi # Check the stage 2 build worked From 268544a5aa40456c0659a5c4b7b289472169fa98 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 20:18:19 +0200 Subject: [PATCH 13/89] sccache: update of the path --- debian/rules | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/debian/rules b/debian/rules index b2284c8e..f6d1cdf2 100755 --- a/debian/rules +++ b/debian/rules @@ -421,14 +421,14 @@ ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) endif # if sccache is installed in the chroot, use it -ifeq ($(shell test -e /tmp/sccache/sccache && echo -n yes),yes) +ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) ifneq (,$(filter $(DISTRO),bullseye)) - export SCCACHE_GCS_KEY_PATH=/tmp/sccache/secret-gcp-storage.json + export SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache export SCCACHE_GCS_RW_MODE=READ_WRITE export SCCACHE_LOG=sccache=debug - export SCCACHE_ERROR_LOG=/tmp/sccache/sccache.log - STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/tmp/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/tmp/sccache/sccache + export SCCACHE_ERROR_LOG=/opt/sccache/sccache.log + STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache endif endif @@ -647,19 +647,19 @@ override_dh_auto_configure: preconfigure VERBOSE=-v debian-full-build: - if test ! -f /tmp/sccache/secret-gcp-storage.json -a -f /tmp/sccache/sccache; then \ - echo "Could not find /tmp/sccache/secret-gcp-storage.json"; \ + if test ! -f /opt/sccache/secret-gcp-storage.json -a -f /opt/sccache/sccache; then \ + echo "Could not find /opt/sccache/secret-gcp-storage.json"; \ fi echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ - VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat /tmp/sccache/sccache.log + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat /opt/sccache/sccache.log # If we used sccache, shows stats - if test -f /tmp/sccache/sccache; then \ - /tmp/sccache/sccache --show-stats; \ - cat /tmp/sccache/sccache.log; \ + if test -f /opt/sccache/sccache; then \ + /opt/sccache/sccache --show-stats; \ + cat /opt/sccache/sccache.log; \ fi # Check the stage 2 build worked From 9d0cc091ecc4af769bc031e6db048d9db69b4c73 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 22:48:31 +0200 Subject: [PATCH 14/89] sccache create the log if needed --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index f6d1cdf2..cb71f972 100755 --- a/debian/rules +++ b/debian/rules @@ -514,6 +514,9 @@ override_dh_ocamlclean: override_dh_ocaml: override_dh_auto_configure: preconfigure + if test -f /opt/sccache/sccache; then \ + touch $CCACHE_ERROR_LOG; \ + fi echo "Using gcc: " $(CC) -v mkdir -p $(TARGET_BUILD) From ba52c797455caffc3add6ba843f7e0badfbfad40 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 23:05:52 +0200 Subject: [PATCH 15/89] improve the log debug --- debian/rules | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index cb71f972..0e78517c 100755 --- a/debian/rules +++ b/debian/rules @@ -516,6 +516,7 @@ override_dh_ocaml: override_dh_auto_configure: preconfigure if test -f /opt/sccache/sccache; then \ touch $CCACHE_ERROR_LOG; \ + ls -al /opt/sccache/*; \ fi echo "Using gcc: " $(CC) -v @@ -657,12 +658,12 @@ debian-full-build: echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ - VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat /opt/sccache/sccache.log + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat $SCCACHE_ERROR_LOG # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ /opt/sccache/sccache --show-stats; \ - cat /opt/sccache/sccache.log; \ + cat $SCCACHE_ERROR_LOG; \ fi # Check the stage 2 build worked From 154774bb4b972bede7f2814340eced8bb1672dae Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 23:12:06 +0200 Subject: [PATCH 16/89] fix syntax --- debian/rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/rules b/debian/rules index 0e78517c..85298229 100755 --- a/debian/rules +++ b/debian/rules @@ -515,7 +515,7 @@ override_dh_ocaml: override_dh_auto_configure: preconfigure if test -f /opt/sccache/sccache; then \ - touch $CCACHE_ERROR_LOG; \ + touch $$CCACHE_ERROR_LOG; \ ls -al /opt/sccache/*; \ fi echo "Using gcc: " @@ -658,12 +658,12 @@ debian-full-build: echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ - VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat $SCCACHE_ERROR_LOG + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat $$SCCACHE_ERROR_LOG # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ /opt/sccache/sccache --show-stats; \ - cat $SCCACHE_ERROR_LOG; \ + cat $$SCCACHE_ERROR_LOG; \ fi # Check the stage 2 build worked From 3a8266fb1b4a3ccb3a5b7b6299a36738bc045793 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 11 Oct 2022 08:39:40 +0200 Subject: [PATCH 17/89] Update of the build dep llvm-spirv => llvm-spirv-14 --- debian/changelog | 6 ++++++ debian/control | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a4e992ef..2b401425 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-5) unstable; urgency=medium + + * Update of the build dep llvm-spirv => llvm-spirv-14 + + -- Sylvestre Ledru Tue, 11 Oct 2022 08:39:18 +0200 + llvm-toolchain-14 (1:14.0.6-4) unstable; urgency=medium * fix the cmake detection with libmlir diff --git a/debian/control b/debian/control index 6d2770de..58f91da2 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libctypes-ocaml-dev [amd64 arm64 armhf ppc64el riscv64 s390x], dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el riscv64 s390x], libpfm4-dev [linux-any], python3-setuptools, libz3-dev, - llvm-spirv [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], + llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], From 46090b035b97db3c8fc533f4081f6c705ac8dad0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Oct 2022 23:34:26 +0200 Subject: [PATCH 18/89] add more debug ifno --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 85298229..01d3baeb 100755 --- a/debian/rules +++ b/debian/rules @@ -517,6 +517,7 @@ override_dh_auto_configure: preconfigure if test -f /opt/sccache/sccache; then \ touch $$CCACHE_ERROR_LOG; \ ls -al /opt/sccache/*; \ + ls -al /usr/bin/g++-*; \ fi echo "Using gcc: " $(CC) -v From da5c2dd727acbf5f0a97bf9d2b01d6c445ce8792 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 17 Oct 2022 07:39:50 +0200 Subject: [PATCH 19/89] fix a typo --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 01d3baeb..667450a6 100755 --- a/debian/rules +++ b/debian/rules @@ -515,7 +515,7 @@ override_dh_ocaml: override_dh_auto_configure: preconfigure if test -f /opt/sccache/sccache; then \ - touch $$CCACHE_ERROR_LOG; \ + touch $$SCCACHE_ERROR_LOG; \ ls -al /opt/sccache/*; \ ls -al /usr/bin/g++-*; \ fi From e89930d4a9b913fe812bc964df5f2993d096ee82 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 16:35:30 +0200 Subject: [PATCH 20/89] also debug the c++ --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 667450a6..c8ccdc71 100755 --- a/debian/rules +++ b/debian/rules @@ -521,6 +521,7 @@ override_dh_auto_configure: preconfigure fi echo "Using gcc: " $(CC) -v + $(CXX) -v mkdir -p $(TARGET_BUILD) mkdir -p clang/include/clang/Debian sed -e "s|@DEB_PATCHSETVERSION@|$(DEBIAN_REVISION)|" \ From f22e08ac0919cab485c4756fb4e0c38f07c85495 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 16:54:49 +0200 Subject: [PATCH 21/89] try to debug sccache --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index c8ccdc71..46c495c7 100755 --- a/debian/rules +++ b/debian/rules @@ -561,6 +561,7 @@ override_dh_auto_configure: preconfigure echo "Running tests: $(RUN_TEST)" echo "Using cmake: $(CMAKE_BIN)"; \ + SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log \ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \ $(PRE_PROCESS_CONF) $(CMAKE_BIN) -S llvm/ -B $(TARGET_BUILD) \ -G $(GENERATOR) \ From 4056d953f177a66cc9b61853f8d211460544454d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 17:03:24 +0200 Subject: [PATCH 22/89] show the output --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 46c495c7..92814d15 100755 --- a/debian/rules +++ b/debian/rules @@ -665,6 +665,7 @@ debian-full-build: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ + ls -al /opt/sccache/; \ /opt/sccache/sccache --show-stats; \ cat $$SCCACHE_ERROR_LOG; \ fi From b65b1b86ee977f2cbd8b37000c78e5acd1899699 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 17:05:20 +0200 Subject: [PATCH 23/89] show the output --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 92814d15..15be4bdd 100755 --- a/debian/rules +++ b/debian/rules @@ -666,6 +666,7 @@ debian-full-build: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ + ls -al /opt/sccache/sccache /usr/bin/g++-10 llvm/lib/Support/CodeGenCoverage.cpp; \ /opt/sccache/sccache --show-stats; \ cat $$SCCACHE_ERROR_LOG; \ fi From 9124e9a147ee50272a9bc9cf74f40fc6789786df Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 17:10:57 +0200 Subject: [PATCH 24/89] show the output --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 15be4bdd..dc20ac31 100755 --- a/debian/rules +++ b/debian/rules @@ -666,7 +666,7 @@ debian-full-build: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ - ls -al /opt/sccache/sccache /usr/bin/g++-10 llvm/lib/Support/CodeGenCoverage.cpp; \ + ls -al /opt/sccache/sccache /usr/bin/g++-10 /usr/bin/*g++-10 llvm/lib/Support/CodeGenCoverage.cpp; \ /opt/sccache/sccache --show-stats; \ cat $$SCCACHE_ERROR_LOG; \ fi From ae115f52ae31fa63a61e6cce7d52c98b5805ba3c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 17:14:15 +0200 Subject: [PATCH 25/89] start the server --- debian/rules | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index dc20ac31..677abefb 100755 --- a/debian/rules +++ b/debian/rules @@ -420,6 +420,7 @@ ifeq ($(shell test -e /tmp/cmake/bin/cmake && echo -n yes),yes) export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/tmp/cmake/bin/ endif +SCCACHE_ENABLE=no # if sccache is installed in the chroot, use it ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) ifneq (,$(filter $(DISTRO),bullseye)) @@ -429,6 +430,7 @@ ifneq (,$(filter $(DISTRO),bullseye)) export SCCACHE_LOG=sccache=debug export SCCACHE_ERROR_LOG=/opt/sccache/sccache.log STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache + SCCACHE_ENABLE=yes endif endif @@ -558,7 +560,9 @@ override_dh_auto_configure: preconfigure #- to libc++ when libunwind is built #- Matches what is done on brew: #- https://bit.ly/3kDNpC9 - +ifeq (${SCCACHE_ENABLE},yes) + SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server +endif echo "Running tests: $(RUN_TEST)" echo "Using cmake: $(CMAKE_BIN)"; \ SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log \ From f93ae65cf638d89f39aded7a4dbc4e34180ab365 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 17:24:01 +0200 Subject: [PATCH 26/89] kill the server --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 677abefb..96a42c45 100755 --- a/debian/rules +++ b/debian/rules @@ -561,6 +561,7 @@ override_dh_auto_configure: preconfigure #- Matches what is done on brew: #- https://bit.ly/3kDNpC9 ifeq (${SCCACHE_ENABLE},yes) + /opt/sccache/sccache --stop-server SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server endif echo "Running tests: $(RUN_TEST)" From ba6a0af22281747fae8bc25bcfcbeaa55312c1d4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 17:34:10 +0200 Subject: [PATCH 27/89] remove artifacts --- debian/rules | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/debian/rules b/debian/rules index 96a42c45..0c97f371 100755 --- a/debian/rules +++ b/debian/rules @@ -423,16 +423,9 @@ endif SCCACHE_ENABLE=no # if sccache is installed in the chroot, use it ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) -ifneq (,$(filter $(DISTRO),bullseye)) - export SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json - export SCCACHE_GCS_BUCKET=apt-llvm-org-sccache - export SCCACHE_GCS_RW_MODE=READ_WRITE - export SCCACHE_LOG=sccache=debug - export SCCACHE_ERROR_LOG=/opt/sccache/sccache.log STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache SCCACHE_ENABLE=yes endif -endif GENERATOR=Ninja @@ -566,7 +559,6 @@ ifeq (${SCCACHE_ENABLE},yes) endif echo "Running tests: $(RUN_TEST)" echo "Using cmake: $(CMAKE_BIN)"; \ - SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log \ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \ $(PRE_PROCESS_CONF) $(CMAKE_BIN) -S llvm/ -B $(TARGET_BUILD) \ -G $(GENERATOR) \ @@ -659,10 +651,6 @@ endif VERBOSE=-v debian-full-build: - if test ! -f /opt/sccache/secret-gcp-storage.json -a -f /opt/sccache/sccache; then \ - echo "Could not find /opt/sccache/secret-gcp-storage.json"; \ - fi - echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ @@ -671,9 +659,7 @@ debian-full-build: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ - ls -al /opt/sccache/sccache /usr/bin/g++-10 /usr/bin/*g++-10 llvm/lib/Support/CodeGenCoverage.cpp; \ /opt/sccache/sccache --show-stats; \ - cat $$SCCACHE_ERROR_LOG; \ fi # Check the stage 2 build worked From 8579a7d22bf41b2b907af91ce9ba6152f915230c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 21:12:34 +0200 Subject: [PATCH 28/89] improve the sccache usage --- debian/rules | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/debian/rules b/debian/rules index 0c97f371..8b6cc367 100755 --- a/debian/rules +++ b/debian/rules @@ -423,7 +423,8 @@ endif SCCACHE_ENABLE=no # if sccache is installed in the chroot, use it ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) - STAGE_1_CMAKE_EXTRA += -DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache + SCCACHE_CMAKE = -DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache + STAGE_1_CMAKE_EXTRA += $(SCCACHE_CMAKE) SCCACHE_ENABLE=yes endif @@ -510,9 +511,7 @@ override_dh_ocaml: override_dh_auto_configure: preconfigure if test -f /opt/sccache/sccache; then \ - touch $$SCCACHE_ERROR_LOG; \ ls -al /opt/sccache/*; \ - ls -al /usr/bin/g++-*; \ fi echo "Using gcc: " $(CC) -v @@ -554,8 +553,11 @@ override_dh_auto_configure: preconfigure #- Matches what is done on brew: #- https://bit.ly/3kDNpC9 ifeq (${SCCACHE_ENABLE},yes) +# Just in case... /opt/sccache/sccache --stop-server - SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server +# Start the sccache server with the right set of options to use GCP +# SCCACHE_LOG=sccache=debug + SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server endif echo "Running tests: $(RUN_TEST)" echo "Using cmake: $(CMAKE_BIN)"; \ @@ -654,7 +656,7 @@ debian-full-build: echo "Using cmake: $(CMAKE_BIN)" # linker hack so stage2 can link against stage1 libs at runtime LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ - VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2||cat $$SCCACHE_ERROR_LOG + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2 # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ @@ -692,6 +694,7 @@ debian-libclc-build: cd libclc/build && \ $(CMAKE_BIN) ../ \ -G $(GENERATOR) \ + $(SCCACHE_CMAKE) \ -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \ @@ -714,6 +717,7 @@ ifeq (${COMPILER_RT_WASM_ENABLE},yes) mkdir -p build-compiler-rt-$$build; \ $(CMAKE_BIN) -B build-compiler-rt-$$build -S compiler-rt/lib/builtins/ \ -G Ninja \ + $(SCCACHE_CMAKE) \ -DCMAKE_C_COMPILER_TARGET=$$build-unknown-unknown \ -DCMAKE_CXX_COMPILER_TARGET=$$build-unknown-unknown \ -DCMAKE_ASM_COMPILER_TARGET=$$build-unknown-unknown \ From f616f7d5767958d9efe5730e6bdfa7a0adf96297 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 23:20:27 +0200 Subject: [PATCH 29/89] bring back the debu --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 8b6cc367..7a6babd3 100755 --- a/debian/rules +++ b/debian/rules @@ -556,8 +556,7 @@ ifeq (${SCCACHE_ENABLE},yes) # Just in case... /opt/sccache/sccache --stop-server # Start the sccache server with the right set of options to use GCP -# SCCACHE_LOG=sccache=debug - SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server + SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server endif echo "Running tests: $(RUN_TEST)" echo "Using cmake: $(CMAKE_BIN)"; \ @@ -661,6 +660,7 @@ debian-full-build: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ + cat /opt/sccache/sccache.log; \ /opt/sccache/sccache --show-stats; \ fi From 7a069fc1f793ec20a52a0480bce73659884491e8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 23:47:19 +0200 Subject: [PATCH 30/89] sccache needs libcrypto.so.1.1 libssl.so.1.1. help him with ld lib path --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 7a6babd3..dc70513d 100755 --- a/debian/rules +++ b/debian/rules @@ -426,6 +426,7 @@ ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) SCCACHE_CMAKE = -DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache STAGE_1_CMAKE_EXTRA += $(SCCACHE_CMAKE) SCCACHE_ENABLE=yes + export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/opt/sccache endif GENERATOR=Ninja From bed55eac10af3fd6214385f971f4f25a448dd16e Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 19 Oct 2022 09:50:06 +0200 Subject: [PATCH 31/89] sccache: continue if the server isn't started --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index dc70513d..ad8cb5d2 100755 --- a/debian/rules +++ b/debian/rules @@ -555,7 +555,7 @@ override_dh_auto_configure: preconfigure #- https://bit.ly/3kDNpC9 ifeq (${SCCACHE_ENABLE},yes) # Just in case... - /opt/sccache/sccache --stop-server + /opt/sccache/sccache --stop-server||true # Start the sccache server with the right set of options to use GCP SCCACHE_LOG=sccache=debug SCCACHE_ERROR_LOG=/opt/sccache/sccache.log SCCACHE_GCS_KEY_PATH=/opt/sccache/secret-gcp-storage.json SCCACHE_GCS_BUCKET=apt-llvm-org-sccache SCCACHE_GCS_RW_MODE=READ_WRITE /opt/sccache/sccache --start-server endif From a5c11bf30ca03073564f8d08ba20f0d23a35446c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 19 Oct 2022 17:45:00 +0200 Subject: [PATCH 32/89] sccache: run the stats at the end --- debian/rules | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/rules b/debian/rules index ad8cb5d2..484d604a 100755 --- a/debian/rules +++ b/debian/rules @@ -658,13 +658,6 @@ debian-full-build: LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2 -# If we used sccache, shows stats - if test -f /opt/sccache/sccache; then \ - ls -al /opt/sccache/; \ - cat /opt/sccache/sccache.log; \ - /opt/sccache/sccache --show-stats; \ - fi - # Check the stage 2 build worked if ! readelf --string-dump .comment $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \ echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \ @@ -747,7 +740,17 @@ else endif touch $@ -override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build + +sccache-stats: +# If we used sccache, shows stats + if test -f /opt/sccache/sccache; then \ + ls -al /opt/sccache/; \ + cat /opt/sccache/sccache.log; \ + /opt/sccache/sccache --show-stats; \ + fi + touch $@ + +override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build sccache-stats override_dh_prep: build_doc dh_prep From 5429013a458a3b849e762d89685c2913b589d6a0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 21 Oct 2022 21:18:41 +0200 Subject: [PATCH 33/89] do not import tblgen-lsp-server either --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index df0c1d4f..585835ea 100755 --- a/debian/rules +++ b/debian/rules @@ -960,8 +960,8 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake sed -i '/_IMPORT_CHECK_TARGETS tblgen-lsp-server/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|tblgen-lsp-server\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake + sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|tblgen-lsp-server\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From 8d6df3408919ae6761fcb947e714ec70cff52520 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 21 Oct 2022 21:36:01 +0200 Subject: [PATCH 34/89] fix the cmake check --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 585835ea..fc0b2084 100755 --- a/debian/rules +++ b/debian/rules @@ -960,8 +960,8 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake sed -i '/_IMPORT_CHECK_TARGETS tblgen-lsp-server/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|tblgen-lsp-server\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|tblgen-lsp-server\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From 8faa78309e99bb32995922f663aa6171adea55d0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Oct 2022 14:07:44 +0200 Subject: [PATCH 35/89] fix the repack --- debian/unpack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/unpack.sh b/debian/unpack.sh index 946989d2..0fd9f6e8 100644 --- a/debian/unpack.sh +++ b/debian/unpack.sh @@ -1,6 +1,6 @@ set -e ORIG_VERSION=15 -MAJOR_VERSION=15.0.1 # 8.0.1 +MAJOR_VERSION=15.0.3 # 8.0.1 REV=`ls -1 *${ORIG_VERSION}_${MAJOR_VERSION}*~+*xz | tail -1|perl -ne 'print "$1\n" if /~\+(.*)\.orig/;' | sort -ru` VERSION=$REV From 47420905cd7fc4876ea492c83451e3618ba00164 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 21 Oct 2022 21:35:32 +0200 Subject: [PATCH 36/89] test: remove a non existing option in opt. See df0b893d94e69856754a4247a44fd97d4a69b001 --- debian/qualify-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index f56499ef..b99eb5a6 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1264,7 +1264,7 @@ fi opt-$VERSION -S -polly-canonicalize matmul.s > matmul.preopt.ll > /dev/null -opt-$VERSION -basic-aa -polly-ast -analyze matmul.preopt.ll -polly-process-unprofitable > /dev/null +opt-$VERSION -basic-aa -polly-ast matmul.preopt.ll -polly-process-unprofitable > /dev/null if test ! -f /usr/lib/llvm-$VERSION/share/opt-viewer/opt-viewer.py; then echo "Install llvm-$VERSION-tools" exit 42 From 5ecc9b2ee2bcb12e4610cb8fdf2dca5a80b5555a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 21 Oct 2022 23:52:27 +0200 Subject: [PATCH 37/89] also ignore sancov --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index fc0b2084..277f5f9e 100755 --- a/debian/rules +++ b/debian/rules @@ -960,8 +960,8 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake sed -i '/_IMPORT_CHECK_TARGETS tblgen-lsp-server/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake - sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|sancov\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|sancov\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From 495fbfd83518697f0d322cf69c94d21ab8e2c594 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 22 Oct 2022 09:57:04 +0200 Subject: [PATCH 38/89] Fix autopkgtest (remove move stuff from the cmake search) --- debian/changelog | 6 ++++++ debian/rules | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 924b4deb..02a6c7c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-15 (1:15.0.3-1~exp2) experimental; urgency=medium + + * Fix autopkgtest (remove move stuff from the cmake search) + + -- Sylvestre Ledru Fri, 21 Oct 2022 23:53:23 +0200 + llvm-toolchain-15 (1:15.0.3-1~exp1) experimental; urgency=medium * New stable release diff --git a/debian/rules b/debian/rules index 277f5f9e..92b28b70 100755 --- a/debian/rules +++ b/debian/rules @@ -960,8 +960,8 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake sed -i '/_IMPORT_CHECK_TARGETS tblgen-lsp-server/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|sancov\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake - sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|sancov\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|sancov\|Polly\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|sancov\|Polly\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From 300cdbe1eb4c6812cb7d4e51d4fe76f62b31b888 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 22 Oct 2022 15:47:52 +0200 Subject: [PATCH 39/89] move the lto task into a different task --- debian/rules | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/rules b/debian/rules index a188ac15..37083f25 100755 --- a/debian/rules +++ b/debian/rules @@ -853,11 +853,6 @@ override_dh_auto_install: # Clean up temporary files to make sure the install works rm -rf $(find $(TARGET_BUILD) -wholename '*CMakeFiles*' -not -name CMakeLists.txt -a -name "*.dir" -type d) -ifeq (${LTO_ENABLE},yes) - # with LTO, .a contains llvm ir instead of native code. So, recompile them - NJOBS="$(NJOBS)" P_TO_LLVM="$(CURDIR)" VERSION=$(LLVM_VERSION) bash -v debian/llvm-compile-lto-elf.sh $(CXXFLAGS_EXTRA) -endif - # install/fast enables a make install without recompiling temporary files LD_LIBRARY_PATH=$(STAGE_2_LIB_DIR):$$LD_LIBRARY_PATH DESTDIR=$(DEB_INST)/ ninja -C $(TARGET_BUILD) $(VERBOSE) stage2-install @@ -1111,7 +1106,16 @@ endif endif dh_install --fail-missing -override_dh_installdeb: + +repack_a_llvm_ir: +ifeq (${LTO_ENABLE},yes) +# with LTO, .a contains llvm ir instead of native code. So, recompile them + NJOBS="$(NJOBS)" P_TO_LLVM="$(CURDIR)" VERSION=$(LLVM_VERSION) bash -v debian/llvm-compile-lto-elf.sh $(CXXFLAGS_EXTRA) +endif + touch $@ + + +override_dh_installdeb: repack_a_llvm_ir # Managed by the package dh_installdeb -a From 1103ab6e4c4a784983cba745a7b2fd13d96c0aa4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 22 Oct 2022 15:48:26 +0200 Subject: [PATCH 40/89] bring back lto --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 37083f25..7bce8ff7 100755 --- a/debian/rules +++ b/debian/rules @@ -405,8 +405,8 @@ ifeq (,$(filter-out $(LTO_DISABLE_ARCHS), $(DEB_HOST_ARCH))) else # Disable for now because of # https://github.com/llvm/llvm-project/issues/58317#issuecomment-1276190743 - # LTO_ENABLE=yes - # STAGE_2_CMAKE_EXTRA += -DLLVM_ENABLE_LTO="On" + LTO_ENABLE=yes + STAGE_2_CMAKE_EXTRA += -DLLVM_ENABLE_LTO="On" endif endif From 23a67d001dafcae93e097ad7a26f96305f12822e Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 22 Oct 2022 15:49:21 +0200 Subject: [PATCH 41/89] Bring back LTO --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4bf851cc..371a091e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-15 (1:15.0.3-1~exp3) experimental; urgency=medium + + * Bring back LTO + + -- Sylvestre Ledru Sat, 22 Oct 2022 15:48:48 +0200 + llvm-toolchain-15 (1:15.0.3-1~exp2) experimental; urgency=medium * Fix autopkgtest (remove move stuff from the cmake search) From a130b25c41415a79adc370c3d752520a1d3fa2f6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 22 Oct 2022 21:03:25 +0200 Subject: [PATCH 42/89] Cherry-pick upstream fix to unbreak mips (closes: #1022169) Thanks to YunQiang Su for the patch https://reviews.llvm.org/D135553 --- debian/changelog | 3 +++ debian/patches/mips/mips-assert-size.diff | 19 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 23 insertions(+) create mode 100644 debian/patches/mips/mips-assert-size.diff diff --git a/debian/changelog b/debian/changelog index 371a091e..839a3f94 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ llvm-toolchain-15 (1:15.0.3-1~exp3) experimental; urgency=medium * Bring back LTO + * Cherry-pick upstream fix to unbreak mips (closes: #1022169) + Thanks to YunQiang Su for the patch + https://reviews.llvm.org/D135553 -- Sylvestre Ledru Sat, 22 Oct 2022 15:48:48 +0200 diff --git a/debian/patches/mips/mips-assert-size.diff b/debian/patches/mips/mips-assert-size.diff new file mode 100644 index 00000000..1d21e29b --- /dev/null +++ b/debian/patches/mips/mips-assert-size.diff @@ -0,0 +1,19 @@ +Index: llvm-toolchain-15_15.0.3~++20221019061539+4a2c05b05ed0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp +=================================================================== +--- llvm-toolchain-15_15.0.3~++20221019061539+4a2c05b05ed0.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp ++++ llvm-toolchain-15_15.0.3~++20221019061539+4a2c05b05ed0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp +@@ -64,9 +64,12 @@ using namespace __sanitizer; + COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat)); + #endif + +-COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); ++# if defined(__LP64__) || \ ++ (!defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS != 64) ++ COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); ++# endif + +-#if defined(__i386__) ++# if defined(__i386__) + COMPILER_CHECK(struct_kernel_stat64_sz == sizeof(struct stat64)); + #endif + diff --git a/debian/patches/series b/debian/patches/series index aed1635c..ba33665d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -154,3 +154,4 @@ fix-typo-1018770.diff bolt.patch bolt-disable-emit-relocs.patch D124841-fix-powerpc-miscompile.patch +mips/mips-assert-size.diff From 048c3a35fdf93bf59a875cbe52e099d9caf7913a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 22 Oct 2022 22:26:59 +0200 Subject: [PATCH 43/89] document the perfs --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 839a3f94..f79b59ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ llvm-toolchain-15 (1:15.0.3-1~exp3) experimental; urgency=medium - * Bring back LTO + * Bring back LTO - increase the perf of clang by ~4% * Cherry-pick upstream fix to unbreak mips (closes: #1022169) Thanks to YunQiang Su for the patch https://reviews.llvm.org/D135553 From 323d016610b8b6c33811abe1610d417d45a5bca4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 23 Oct 2022 10:36:31 +0200 Subject: [PATCH 44/89] fix changelog --- debian/changelog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f79b59ba..c4f8f10e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-15 (1:15.0.3-1~exp3) experimental; urgency=medium +llvm-toolchain-15 (1:15.0.3-2~exp1) experimental; urgency=medium * Bring back LTO - increase the perf of clang by ~4% * Cherry-pick upstream fix to unbreak mips (closes: #1022169) @@ -7,6 +7,12 @@ llvm-toolchain-15 (1:15.0.3-1~exp3) experimental; urgency=medium -- Sylvestre Ledru Sat, 22 Oct 2022 15:48:48 +0200 +llvm-toolchain-15 (1:15.0.3-1) unstable; urgency=medium + + * Upload to unstable now that autopkgtest is green + + -- Sylvestre Ledru Sun, 23 Oct 2022 10:34:58 +0200 + llvm-toolchain-15 (1:15.0.3-1~exp2) experimental; urgency=medium * Fix autopkgtest (remove move stuff from the cmake search) From 89e328e76bfd691f26934fe7c22181ee0454702b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 23 Oct 2022 16:08:11 +0200 Subject: [PATCH 45/89] Unbreak the cmake detection (Closes: #1021857, #1022414) --- debian/changelog | 6 ++++++ debian/rules | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2b401425..967e3e0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-6) unstable; urgency=medium + + * Unbreak the cmake detection (Closes: #1021857, #1022414) + + -- Sylvestre Ledru Sun, 23 Oct 2022 16:07:45 +0200 + llvm-toolchain-14 (1:14.0.6-5) unstable; urgency=medium * Update of the build dep llvm-spirv => llvm-spirv-14 diff --git a/debian/rules b/debian/rules index 484d604a..6a6abcb8 100755 --- a/debian/rules +++ b/debian/rules @@ -938,8 +938,8 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_cmake_import_check_files_for_mli/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-release.cmake - sed -i '/_cmake_import_check_files_for_MLIR/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-release.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|sancov\|Polly\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|sancov\|Polly\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From 3bb6cd043834a55c0fcaab6d8bac2a978a6aba78 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 23 Oct 2022 16:08:57 +0200 Subject: [PATCH 46/89] add a test for wasm --- debian/qualify-clang.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index d96ed9a7..dfda6e44 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1374,6 +1374,9 @@ EOF fi rm -f printf.c printf fi +echo '#include ' > foo.cpp +# Fails for now +clang++-$VERSION --target=wasm32-wasi -o foo.o -c foo.cpp||true echo ' #include From 86b2f11f95a6fa8e9cb1ed03788052b3ac578eb0 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 26 Oct 2022 08:30:23 +0200 Subject: [PATCH 47/89] disable lto again for failing --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 7bce8ff7..1a82e96e 100755 --- a/debian/rules +++ b/debian/rules @@ -405,8 +405,8 @@ ifeq (,$(filter-out $(LTO_DISABLE_ARCHS), $(DEB_HOST_ARCH))) else # Disable for now because of # https://github.com/llvm/llvm-project/issues/58317#issuecomment-1276190743 - LTO_ENABLE=yes - STAGE_2_CMAKE_EXTRA += -DLLVM_ENABLE_LTO="On" +# LTO_ENABLE=yes +# STAGE_2_CMAKE_EXTRA += -DLLVM_ENABLE_LTO="On" endif endif From 62db712de0e6bd031537db127297567f8904408d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 26 Oct 2022 09:23:31 +0200 Subject: [PATCH 48/89] disable sccache on bionic --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index 6a6abcb8..3b8ab21f 100755 --- a/debian/rules +++ b/debian/rules @@ -429,6 +429,11 @@ ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/opt/sccache endif +# Disable sccache on bionic +ifneq (,$(filter $(DISTRO),bionic)) + SCCACHE_ENABLE=no +endif + GENERATOR=Ninja # enables cmake build targets like stage2-[target_name] From 6dcaabaaa00fd19f3fd9e2eb4056e628ffe3eb70 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 26 Oct 2022 09:23:55 +0200 Subject: [PATCH 49/89] disable sccache on bionic --- debian/rules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/rules b/debian/rules index 1a82e96e..5b569577 100755 --- a/debian/rules +++ b/debian/rules @@ -449,6 +449,10 @@ ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) SCCACHE_ENABLE=yes export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/opt/sccache endif +# Disable sccache on bionic +ifneq (,$(filter $(DISTRO),bionic)) + SCCACHE_ENABLE=no +endif # enables cmake build targets like stage2-[target_name] ENABLED_STAGE2_CMAKE_BUILD_TARGETS = check-all;check-llvm;check-clang;check-clang-tools;check-lld;check-libcxx;check-libcxxabi;check-mlir;check-sanitizer;llvm-config;test-suite From 0209958cde6c85b2247aa0537830ace9105a6821 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:31 -0700 Subject: [PATCH 50/89] d/changelog: Start 1:14.0.6-7 changelog Signed-off-by: Jordan Justen --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 967e3e0a..bd9827dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-14 (1:14.0.6-7) UNRELEASED; urgency=medium + + [ Sylvestre Ledru ] + * disable sccache on bionic + + -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 + llvm-toolchain-14 (1:14.0.6-6) unstable; urgency=medium * Unbreak the cmake detection (Closes: #1021857, #1022414) From 3606129645cbe168c7a65b74116474616f20ab0c Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:47 -0700 Subject: [PATCH 51/89] d/rules: Call bash to use 'command -v' to location llvm-spirv executable Signed-off-by: Jordan Justen --- debian/changelog | 3 +++ debian/rules | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bd9827dd..a34e97ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ llvm-toolchain-14 (1:14.0.6-7) UNRELEASED; urgency=medium [ Sylvestre Ledru ] * disable sccache on bionic + [ Jordan Justen ] + * d/rules: Call bash to use 'command -v' to location llvm-spirv executable + -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 llvm-toolchain-14 (1:14.0.6-6) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 3b8ab21f..f64e7549 100755 --- a/debian/rules +++ b/debian/rules @@ -223,8 +223,10 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -ifeq ($(shell command -v llvm-spirv),) -LLVM_SPIRV_INSTALLED = no +LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv" 2>/dev/null) + +ifndef LLVM_SPIRV + LLVM_SPIRV_INSTALLED = no else ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) # Too old llvm-spirv version are failing. See #52200 From a57d00a036f1d71a877336c021b39d05d7846233 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:56 -0700 Subject: [PATCH 52/89] d/rules: Set LLVM_SPIRV with cmake for libclc Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a34e97ab..bbe280a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ llvm-toolchain-14 (1:14.0.6-7) UNRELEASED; urgency=medium [ Jordan Justen ] * d/rules: Call bash to use 'command -v' to location llvm-spirv executable + * d/rules: Set LLVM_SPIRV with cmake for libclc -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/rules b/debian/rules index f64e7549..efa4560d 100755 --- a/debian/rules +++ b/debian/rules @@ -237,8 +237,10 @@ else endif LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" +LIBCLC_TARGETS_LLVM_SPIRV := "" ifeq ($(LLVM_SPIRV_INSTALLED),yes) LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD)";spirv-mesa3d-;spirv64-mesa3d-" + LIBCLC_TARGETS_LLVM_SPIRV := "-DLLVM_SPIRV=$(LLVM_SPIRV)" endif BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el x32 s390x hurd-i386 kfreebsd-amd64 kfreebsd-i386 @@ -707,7 +709,8 @@ debian-libclc-build: -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ - -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ + -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD) \ + $(LIBCLC_TARGETS_LLVM_SPIRV); \ ninja $(NJOBS) $(VERBOSE) touch $@ From d214584519939ccc4cacfb5d40220d296bc7fa0b Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:23:06 -0700 Subject: [PATCH 53/89] d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/patches/libclc-llvm-spirv.diff | 13 ------------- debian/patches/series | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 debian/patches/libclc-llvm-spirv.diff diff --git a/debian/changelog b/debian/changelog index bbe280a7..ba8dbe85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ llvm-toolchain-14 (1:14.0.6-7) UNRELEASED; urgency=medium [ Jordan Justen ] * d/rules: Call bash to use 'command -v' to location llvm-spirv executable * d/rules: Set LLVM_SPIRV with cmake for libclc + * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/patches/libclc-llvm-spirv.diff b/debian/patches/libclc-llvm-spirv.diff deleted file mode 100644 index 2d6e85bf..00000000 --- a/debian/patches/libclc-llvm-spirv.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt -index b8b5ceff086c..5964468358f2 100644 ---- a/libclc/CMakeLists.txt -+++ b/libclc/CMakeLists.txt -@@ -97,7 +97,7 @@ find_program( LLVM_CLANG clang PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_AS llvm-as PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_LINK llvm-link PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_OPT opt PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) --find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) -+find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR}) - - # Print toolchain - message( "clang: ${LLVM_CLANG}" ) diff --git a/debian/patches/series b/debian/patches/series index d2389a5a..a2fe91ba 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -135,7 +135,6 @@ print-lldb-path.patch lower-python-dep.diff scan-build-py-fix-default-bin.diff -libclc-llvm-spirv.diff omp-riscv64.patch test-disable-lldb-i386.diff unbreak-atomic-mips.diff From d03015ee7c5ecdb484227bb53c9ee91ef80755fa Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:23:14 -0700 Subject: [PATCH 54/89] d/rules: Check for llvm-spirv with version suffix Since llvm-spirv-13, the '-13' suffix has been added to the executable. Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index ba8dbe85..d128799c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ llvm-toolchain-14 (1:14.0.6-7) UNRELEASED; urgency=medium * d/rules: Call bash to use 'command -v' to location llvm-spirv executable * d/rules: Set LLVM_SPIRV with cmake for libclc * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV + * d/rules: Check for llvm-spirv with version suffix -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/rules b/debian/rules index efa4560d..f5739224 100755 --- a/debian/rules +++ b/debian/rules @@ -223,16 +223,22 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv" 2>/dev/null) +LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv llvm-spirv-$(LLVM_VERSION)" 2>/dev/null) ifndef LLVM_SPIRV LLVM_SPIRV_INSTALLED = no else - ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) -# Too old llvm-spirv version are failing. See #52200 - LLVM_SPIRV_INSTALLED = yes + # if executable is llvm-spirv without a -$(LLVM_VERSION) suffix + ifeq ($(LLVM_SPIRV:-$(LLVM_VERSION)=),$(LLVM_SPIRV)) + # Too old llvm-spirv version are failing. See #52200 + ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) + LLVM_SPIRV_INSTALLED = yes + else + LLVM_SPIRV_INSTALLED = no + endif else - LLVM_SPIRV_INSTALLED = no + # llvm-spirv renamed llvm-spirv-$(LLVM_VERSION) as of llvm-spirv-13 + LLVM_SPIRV_INSTALLED = yes endif endif From 29308f4310a26ad5b236d23a6eca224131f6b20f Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:31 -0700 Subject: [PATCH 55/89] d/changelog: Start 1:13.0.1-8 changelog Signed-off-by: Jordan Justen --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 71a10603..8445a941 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium + + * New changelog + + -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 + llvm-toolchain-13 (1:13.0.1-7) unstable; urgency=medium [ Michael Biebl ] From 265a70d7d07477c29a2b4ac5878f39bd46ba1095 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 18 Oct 2021 16:15:10 +0200 Subject: [PATCH 56/89] Disable the build of libclc on old Ubuntu (Groovy & focal) as llvm-spir is too old on these version. See bug #52200 --- debian/changelog | 5 ++++- debian/rules | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8445a941..3889fb14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium - * New changelog + [ Sylvestre Ledru ] + * Disable the build of libclc on old Ubuntu (Groovy & focal) + as llvm-spir is too old on these version. + See bug #52200 -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/rules b/debian/rules index e5d8cc21..cce08fec 100755 --- a/debian/rules +++ b/debian/rules @@ -217,7 +217,12 @@ endif ifeq ($(shell command -v llvm-spirv),) LLVM_SPIRV_INSTALLED = no else -LLVM_SPIRV_INSTALLED = yes + ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) ge 10.0.0 ; echo $$?),0) +# Too old llvm-spirv version are failing. See #52200 + LLVM_SPIRV_INSTALLED = yes + else + LLVM_SPIRV_INSTALLED = no + endif endif LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" From 34a7ac73ed9387fc9efa0f179f7ae8c837be8af6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 18 Oct 2021 17:53:32 +0200 Subject: [PATCH 57/89] fix the version check --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index cce08fec..9e4f0438 100755 --- a/debian/rules +++ b/debian/rules @@ -217,7 +217,7 @@ endif ifeq ($(shell command -v llvm-spirv),) LLVM_SPIRV_INSTALLED = no else - ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) ge 10.0.0 ; echo $$?),0) + ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) # Too old llvm-spirv version are failing. See #52200 LLVM_SPIRV_INSTALLED = yes else From 0951f6940528c215a27c28b0989f6a1f73459827 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:47 -0700 Subject: [PATCH 58/89] d/rules: Call bash to use 'command -v' to location llvm-spirv executable Signed-off-by: Jordan Justen --- debian/changelog | 3 +++ debian/rules | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3889fb14..f8978b69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium as llvm-spir is too old on these version. See bug #52200 + [ Jordan Justen ] + * d/rules: Call bash to use 'command -v' to location llvm-spirv executable + -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 llvm-toolchain-13 (1:13.0.1-7) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 9e4f0438..fafa5d47 100755 --- a/debian/rules +++ b/debian/rules @@ -214,8 +214,10 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -ifeq ($(shell command -v llvm-spirv),) -LLVM_SPIRV_INSTALLED = no +LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv" 2>/dev/null) + +ifndef LLVM_SPIRV + LLVM_SPIRV_INSTALLED = no else ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) # Too old llvm-spirv version are failing. See #52200 From 966bddda9db74b415a19744fa726c19f6d1ff0a9 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:56 -0700 Subject: [PATCH 59/89] d/rules: Set LLVM_SPIRV with cmake for libclc Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f8978b69..b30538a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium [ Jordan Justen ] * d/rules: Call bash to use 'command -v' to location llvm-spirv executable + * d/rules: Set LLVM_SPIRV with cmake for libclc -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/rules b/debian/rules index fafa5d47..475cb7f9 100755 --- a/debian/rules +++ b/debian/rules @@ -228,8 +228,10 @@ else endif LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" +LIBCLC_TARGETS_LLVM_SPIRV := "" ifeq ($(LLVM_SPIRV_INSTALLED),yes) LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD)";spirv-mesa3d-;spirv64-mesa3d-" + LIBCLC_TARGETS_LLVM_SPIRV := "-DLLVM_SPIRV=$(LLVM_SPIRV)" endif BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el x32 s390x hurd-i386 kfreebsd-amd64 kfreebsd-i386 @@ -642,7 +644,8 @@ debian-libclc-build: -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ - -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ + -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD) \ + $(LIBCLC_TARGETS_LLVM_SPIRV); \ ninja $(NJOBS) $(VERBOSE) touch $@ From 91091e3de5cdb7a7b3213e63b7355423562fc9e9 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:23:06 -0700 Subject: [PATCH 60/89] d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/patches/libclc-llvm-spirv.diff | 13 ------------- debian/patches/series | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 debian/patches/libclc-llvm-spirv.diff diff --git a/debian/changelog b/debian/changelog index b30538a8..94bb3176 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium [ Jordan Justen ] * d/rules: Call bash to use 'command -v' to location llvm-spirv executable * d/rules: Set LLVM_SPIRV with cmake for libclc + * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/patches/libclc-llvm-spirv.diff b/debian/patches/libclc-llvm-spirv.diff deleted file mode 100644 index 2d6e85bf..00000000 --- a/debian/patches/libclc-llvm-spirv.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt -index b8b5ceff086c..5964468358f2 100644 ---- a/libclc/CMakeLists.txt -+++ b/libclc/CMakeLists.txt -@@ -97,7 +97,7 @@ find_program( LLVM_CLANG clang PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_AS llvm-as PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_LINK llvm-link PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_OPT opt PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) --find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) -+find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR}) - - # Print toolchain - message( "clang: ${LLVM_CLANG}" ) diff --git a/debian/patches/series b/debian/patches/series index 8bd4827f..cbe6d748 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -138,7 +138,6 @@ lower-python-dep.diff scan-build-py-fix-analyze-path.diff scan-build-py-fix-default-bin.diff -libclc-llvm-spirv.diff omp-riscv64.patch test-disable-lldb-i386.diff unbreak-atomic-mips.diff From a3165e69a2e695f72698fe3795685a2726e03f4e Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:23:14 -0700 Subject: [PATCH 61/89] d/rules: Check for llvm-spirv with version suffix Since llvm-spirv-13, the '-13' suffix has been added to the executable. Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 94bb3176..5d043c99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium * d/rules: Call bash to use 'command -v' to location llvm-spirv executable * d/rules: Set LLVM_SPIRV with cmake for libclc * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV + * d/rules: Check for llvm-spirv with version suffix -- Jordan Justen Wed, 26 Oct 2022 10:13:59 -0700 diff --git a/debian/rules b/debian/rules index 475cb7f9..891ce6b9 100755 --- a/debian/rules +++ b/debian/rules @@ -214,16 +214,22 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv" 2>/dev/null) +LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv llvm-spirv-$(LLVM_VERSION)" 2>/dev/null) ifndef LLVM_SPIRV LLVM_SPIRV_INSTALLED = no else - ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) -# Too old llvm-spirv version are failing. See #52200 - LLVM_SPIRV_INSTALLED = yes + # if executable is llvm-spirv without a -$(LLVM_VERSION) suffix + ifeq ($(LLVM_SPIRV:-$(LLVM_VERSION)=),$(LLVM_SPIRV)) + # Too old llvm-spirv version are failing. See #52200 + ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0) + LLVM_SPIRV_INSTALLED = yes + else + LLVM_SPIRV_INSTALLED = no + endif else - LLVM_SPIRV_INSTALLED = no + # llvm-spirv renamed llvm-spirv-$(LLVM_VERSION) as of llvm-spirv-13 + LLVM_SPIRV_INSTALLED = yes endif endif From 53ad1796240a07feab11c4095da66fd3724ff222 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 27 Oct 2022 11:50:50 +0200 Subject: [PATCH 62/89] prepare upload --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5d043c99..76514b61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium +llvm-toolchain-13 (1:13.0.1-8) unstable; urgency=medium [ Sylvestre Ledru ] * Disable the build of libclc on old Ubuntu (Groovy & focal) From e10ac5c55f5696ae9c90da285f7c63a745238220 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 27 Oct 2022 12:47:30 +0200 Subject: [PATCH 63/89] Disable the cmake search for all binaries (cmake_import_check_files_for.*/bin/). Dunno why it regressed but we wasted too much time on this. --- debian/changelog | 8 ++++++++ debian/rules | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 967e3e0a..450fc1c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-14 (1:14.0.6-7) unstable; urgency=medium + + * Disable the cmake search for all binaries + (cmake_import_check_files_for.*/bin/). Dunno why it regressed + but we wasted too much time on this. + + -- Sylvestre Ledru Thu, 27 Oct 2022 12:47:19 +0200 + llvm-toolchain-14 (1:14.0.6-6) unstable; urgency=medium * Unbreak the cmake detection (Closes: #1021857, #1022414) diff --git a/debian/rules b/debian/rules index 3b8ab21f..01c163f7 100755 --- a/debian/rules +++ b/debian/rules @@ -943,8 +943,11 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|sancov\|Polly\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake - sed -i '/_cmake_import_check_files_for_\(mlir\|llvm-bolt\|sancov\|Polly\|tblgen-lsp-server\|clang-format\|merge-fdata\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + + sed -i '/_cmake_import_check_files_for_.*\/bin\/.*/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_.*\/bin\/.*/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|Polly\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake + sed -i '/_cmake_import_check_files_for_\(mlir\|Polly\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From 0e6da0b3566cf0e363dcbf7a2146f3517998a9f6 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Fri, 28 Oct 2022 10:19:42 -0700 Subject: [PATCH 64/89] d/changelog: Start 1:13.0.1-9 changelog Signed-off-by: Jordan Justen --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 76514b61..db610918 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-13 (1:13.0.1-9) UNRELEASED; urgency=medium + + * UNRELEASED + + -- Jordan Justen Fri, 28 Oct 2022 10:17:57 -0700 + llvm-toolchain-13 (1:13.0.1-8) unstable; urgency=medium [ Sylvestre Ledru ] From 37a8a75e8630b00daf4667b492976d89fc226ad6 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Fri, 28 Oct 2022 10:21:39 -0700 Subject: [PATCH 65/89] d/rules: Don't send an empty string to cmake when llvm-spirv is not found Signed-off-by: Jordan Justen --- debian/changelog | 2 +- debian/rules | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index db610918..cfac21b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ llvm-toolchain-13 (1:13.0.1-9) UNRELEASED; urgency=medium - * UNRELEASED + * d/rules: Don't send an empty string to cmake when llvm-spirv is not found -- Jordan Justen Fri, 28 Oct 2022 10:17:57 -0700 diff --git a/debian/rules b/debian/rules index 891ce6b9..698482c0 100755 --- a/debian/rules +++ b/debian/rules @@ -234,10 +234,10 @@ else endif LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" -LIBCLC_TARGETS_LLVM_SPIRV := "" +LIBCLC_TARGETS_LLVM_SPIRV = ifeq ($(LLVM_SPIRV_INSTALLED),yes) LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD)";spirv-mesa3d-;spirv64-mesa3d-" - LIBCLC_TARGETS_LLVM_SPIRV := "-DLLVM_SPIRV=$(LLVM_SPIRV)" + LIBCLC_TARGETS_LLVM_SPIRV = "-DLLVM_SPIRV=$(LLVM_SPIRV)" endif BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el x32 s390x hurd-i386 kfreebsd-amd64 kfreebsd-i386 From 2ae5beca4f01a8e8ee74fd1411b2f5596d394e61 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 29 Oct 2022 09:08:20 +0200 Subject: [PATCH 66/89] remove the failed bionic sccache stuff --- debian/rules | 5 ----- 1 file changed, 5 deletions(-) diff --git a/debian/rules b/debian/rules index bbf1da04..09938ac3 100755 --- a/debian/rules +++ b/debian/rules @@ -439,11 +439,6 @@ ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/opt/sccache endif -# Disable sccache on bionic -ifneq (,$(filter $(DISTRO),bionic)) - SCCACHE_ENABLE=no -endif - GENERATOR=Ninja # enables cmake build targets like stage2-[target_name] From 47f6ef82d626b79e49157f545c3c745e540c25e5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 29 Oct 2022 09:09:02 +0200 Subject: [PATCH 67/89] remove the failed bionic sccache stuff --- debian/changelog | 5 ++--- debian/rules | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index c4f8f10e..d1798f60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,10 @@ -llvm-toolchain-15 (1:15.0.3-2~exp1) experimental; urgency=medium +llvm-toolchain-15 (1:15.0.3-2) unstable; urgency=medium - * Bring back LTO - increase the perf of clang by ~4% * Cherry-pick upstream fix to unbreak mips (closes: #1022169) Thanks to YunQiang Su for the patch https://reviews.llvm.org/D135553 - -- Sylvestre Ledru Sat, 22 Oct 2022 15:48:48 +0200 + -- Sylvestre Ledru Fri, 28 Oct 2022 10:25:45 +0200 llvm-toolchain-15 (1:15.0.3-1) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 5b569577..1a82e96e 100755 --- a/debian/rules +++ b/debian/rules @@ -449,10 +449,6 @@ ifeq ($(shell test -e /opt/sccache/sccache && echo -n yes),yes) SCCACHE_ENABLE=yes export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/opt/sccache endif -# Disable sccache on bionic -ifneq (,$(filter $(DISTRO),bionic)) - SCCACHE_ENABLE=no -endif # enables cmake build targets like stage2-[target_name] ENABLED_STAGE2_CMAKE_BUILD_TARGETS = check-all;check-llvm;check-clang;check-clang-tools;check-lld;check-libcxx;check-libcxxabi;check-mlir;check-sanitizer;llvm-config;test-suite From df549cc1e1313c80b10fc39208e3442a69a3aca2 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sun, 30 Oct 2022 00:27:16 -0700 Subject: [PATCH 68/89] d/changelog: Start 1:15.0.3-3 changelog Signed-off-by: Jordan Justen --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index d1798f60..11a9f1f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium + + * UNRELEASED + + -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 + llvm-toolchain-15 (1:15.0.3-2) unstable; urgency=medium * Cherry-pick upstream fix to unbreak mips (closes: #1022169) From 45ef20d146ca569e5ceb0ab9c78be4eef4fd9adc Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sat, 29 Oct 2022 02:05:30 -0700 Subject: [PATCH 69/89] d/rules: Rename LLVM_SPIR_VERSION to LLVM_SPIRV_VERSION Signed-off-by: Jordan Justen --- debian/changelog | 3 ++- debian/rules | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 11a9f1f7..4936ca49 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium - * UNRELEASED + [ Jordan Justen ] + * d/rules: Rename LLVM_SPIR_VERSION to LLVM_SPIRV_VERSION -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/rules b/debian/rules index 1a82e96e..b769d352 100755 --- a/debian/rules +++ b/debian/rules @@ -243,11 +243,11 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -LLVM_SPIR_VERSION=14 -ifeq ($(shell command -v llvm-spirv-$(LLVM_SPIR_VERSION)),) +LLVM_SPIRV_VERSION=14 +ifeq ($(shell command -v llvm-spirv-$(LLVM_SPIRV_VERSION)),) LLVM_SPIRV_INSTALLED = no else - ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv-$(LLVM_SPIR_VERSION)) gt 14.0.0 ; echo $$?),0) + ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv-$(LLVM_SPIRV_VERSION)) gt 14.0.0 ; echo $$?),0) # Too old llvm-spirv version are failing. See #52200 LLVM_SPIRV_INSTALLED = yes else @@ -733,7 +733,7 @@ ifeq ($(LLVM_SPIRV_INSTALLED),yes) -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ - -DLLVM_SPIRV=/usr/bin/llvm-spirv-$(LLVM_SPIR_VERSION) \ + -DLLVM_SPIRV=/usr/bin/llvm-spirv-$(LLVM_SPIRV_VERSION) \ -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ ninja -j $(NJOBS) $(VERBOSE) else From 277362b9a849c304e683ce1fe5921e95856afc18 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:47 -0700 Subject: [PATCH 70/89] d/rules: Call bash to use 'command -v' to locate llvm-spirv executable I needed this for sbuild to find the executable. Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4936ca49..47c37eb3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium [ Jordan Justen ] * d/rules: Rename LLVM_SPIR_VERSION to LLVM_SPIRV_VERSION + * d/rules: Call bash to use 'command -v' to locate llvm-spirv executable -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/rules b/debian/rules index b769d352..eb626262 100755 --- a/debian/rules +++ b/debian/rules @@ -244,8 +244,10 @@ else endif LLVM_SPIRV_VERSION=14 -ifeq ($(shell command -v llvm-spirv-$(LLVM_SPIRV_VERSION)),) -LLVM_SPIRV_INSTALLED = no +LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv-$(LLVM_SPIRV_VERSION)" 2>/dev/null) + +ifndef LLVM_SPIRV + LLVM_SPIRV_INSTALLED = no else ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv-$(LLVM_SPIRV_VERSION)) gt 14.0.0 ; echo $$?),0) # Too old llvm-spirv version are failing. See #52200 From 5c8a71515a4c9fcfb98c5e7b548122701a314234 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Fri, 28 Oct 2022 14:11:53 -0700 Subject: [PATCH 71/89] debian: Bump llvm-spirv to 15 to match the llvm version Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/control | 2 +- debian/rules | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 47c37eb3..9126ac5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium [ Jordan Justen ] * d/rules: Rename LLVM_SPIR_VERSION to LLVM_SPIRV_VERSION * d/rules: Call bash to use 'command -v' to locate llvm-spirv executable + * debian: Bump llvm-spirv to 15 to match the llvm version -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/control b/debian/control index d91b7d80..7df354bb 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libctypes-ocaml-dev [amd64 arm64 armhf ppc64el riscv64 s390x], dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el riscv64 s390x], libpfm4-dev [linux-any], python3-setuptools, libz3-dev, - llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], + llvm-spirv-15 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], diff --git a/debian/rules b/debian/rules index eb626262..c8b483d2 100755 --- a/debian/rules +++ b/debian/rules @@ -243,7 +243,7 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -LLVM_SPIRV_VERSION=14 +LLVM_SPIRV_VERSION := $(LLVM_VERSION) LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv-$(LLVM_SPIRV_VERSION)" 2>/dev/null) ifndef LLVM_SPIRV From 41a4a741ff693bf5c25dde73197505600e3190ca Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:22:56 -0700 Subject: [PATCH 72/89] d/rules: Set LLVM_SPIRV with cmake for libclc Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9126ac5d..dca5e80a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium * d/rules: Rename LLVM_SPIR_VERSION to LLVM_SPIRV_VERSION * d/rules: Call bash to use 'command -v' to locate llvm-spirv executable * debian: Bump llvm-spirv to 15 to match the llvm version + * d/rules: Set LLVM_SPIRV with cmake for libclc -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/rules b/debian/rules index c8b483d2..e4a0d176 100755 --- a/debian/rules +++ b/debian/rules @@ -258,8 +258,10 @@ else endif LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" +LIBCLC_LLVM_SPIRV = ifeq ($(LLVM_SPIRV_INSTALLED),yes) LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD)";spirv-mesa3d-;spirv64-mesa3d-" + LIBCLC_LLVM_SPIRV = "-DLLVM_SPIRV=$(LLVM_SPIRV)" endif BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el x32 s390x hurd-i386 kfreebsd-amd64 kfreebsd-i386 @@ -735,7 +737,7 @@ ifeq ($(LLVM_SPIRV_INSTALLED),yes) -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ - -DLLVM_SPIRV=/usr/bin/llvm-spirv-$(LLVM_SPIRV_VERSION) \ + $(LIBCLC_LLVM_SPIRV) \ -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ ninja -j $(NJOBS) $(VERBOSE) else From 8e0566635617d70d9500b217120ed439e0d26c60 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 26 Oct 2022 10:23:06 -0700 Subject: [PATCH 73/89] d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/patches/libclc-llvm-spirv.diff | 13 ------------- debian/patches/series | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 debian/patches/libclc-llvm-spirv.diff diff --git a/debian/changelog b/debian/changelog index dca5e80a..25021b0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium * d/rules: Call bash to use 'command -v' to locate llvm-spirv executable * debian: Bump llvm-spirv to 15 to match the llvm version * d/rules: Set LLVM_SPIRV with cmake for libclc + * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/patches/libclc-llvm-spirv.diff b/debian/patches/libclc-llvm-spirv.diff deleted file mode 100644 index 405391a4..00000000 --- a/debian/patches/libclc-llvm-spirv.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/libclc/CMakeLists.txt -=================================================================== ---- llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8.orig/libclc/CMakeLists.txt -+++ llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/libclc/CMakeLists.txt -@@ -99,7 +99,7 @@ find_program( LLVM_CLANG clang PATHS ${L - find_program( LLVM_AS llvm-as PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_LINK llvm-link PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) - find_program( LLVM_OPT opt PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) --find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) -+find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR}) - - # Print toolchain - message( "clang: ${LLVM_CLANG}" ) diff --git a/debian/patches/series b/debian/patches/series index ba33665d..3326826c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -126,7 +126,6 @@ print-lldb-path.patch lower-python-dep.diff scan-build-py-fix-default-bin.diff -libclc-llvm-spirv.diff omp-riscv64.patch test-disable-lldb-i386.diff unbreak-atomic-mips.diff From 0336f15cfeb39d92bf416e2e14905a879a9942e0 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sat, 29 Oct 2022 02:35:58 -0700 Subject: [PATCH 74/89] d/rules: Build libclc .bc files even when .spv files can't be built Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/libclc-X.Y.install.in | 2 +- debian/rules | 21 ++++++++------------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 25021b0f..ae0f0704 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium * debian: Bump llvm-spirv to 15 to match the llvm version * d/rules: Set LLVM_SPIRV with cmake for libclc * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV + * d/rules: Restore building libclc .bc output without spir-v support -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/libclc-X.Y.install.in b/debian/libclc-X.Y.install.in index 679ba86f..923094ff 100644 --- a/debian/libclc-X.Y.install.in +++ b/debian/libclc-X.Y.install.in @@ -1,2 +1,2 @@ usr/lib/clc/*.bc -usr/lib/clc/*.spv +#spv usr/lib/clc/*.spv diff --git a/debian/rules b/debian/rules index e4a0d176..f1179237 100755 --- a/debian/rules +++ b/debian/rules @@ -522,12 +522,12 @@ preconfigure: fi; \ fi - # Conditionally enable *.spv files. Debian buster and Ubuntu 18.04 - # don't have llvm-spirv to create the *.spv files. - if test "$(LLVM_SPIRV_INSTALLED)" = "no"; then \ - echo "" > debian/libclc-$(LLVM_VERSION).install; \ - echo "" > debian/libclc-$(LLVM_VERSION)-dev.install; \ - fi +ifdef LLVM_SPIRV + # llvm-spirv was found, so we can enable *.spv files. Debian + # buster and Ubuntu 18.04 don't have llvm-spirv to create the + # *.spv files. + sed -i -e "s|#spv\ ||g" debian/libclc-$(LLVM_VERSION).install +endif if test "$(DISTRO)" = "stretch"; then \ echo "" > debian/python3-lldb-$(LLVM_VERSION).install; \ fi @@ -718,7 +718,6 @@ endif touch $@ debian-libclc-build: -ifeq ($(LLVM_SPIRV_INSTALLED),yes) # Builds libclc mkdir -p libclc/build echo "Using cmake: $(CMAKE_BIN)" @@ -740,8 +739,8 @@ ifeq ($(LLVM_SPIRV_INSTALLED),yes) $(LIBCLC_LLVM_SPIRV) \ -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ ninja -j $(NJOBS) $(VERBOSE) -else - echo "libclc isn't built LLVM_SPIRV_INSTALLED=$(LLVM_SPIRV_INSTALLED)" +ifndef LLVM_SPIRV + echo "libclc built without SPIRV (.spv) outputs because llvm-spirv wasn't found" endif touch $@ @@ -935,9 +934,7 @@ endif # Remove an osx file rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/libbolt_rt_instr_osx.a -ifeq ($(LLVM_SPIRV_INSTALLED),yes) DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install -endif ifeq (${COMPILER_RT_WASM_ENABLE},yes) DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm32 install @@ -1173,10 +1170,8 @@ endif # MLIR ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-mlir || true -ifeq ($(LLVM_SPIRV_INSTALLED),yes) # Libclc ninja $(VERBOSE) -C libclc/build test || true -endif # LLDB tests ifeq (,$(filter $(DEB_HOST_ARCH), $(LLDB_DISABLE_ARCHS) armhf armel)) From 5befbff174406e5bae99c8d91245c628fed0585a Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sun, 30 Oct 2022 15:16:19 -0700 Subject: [PATCH 75/89] d/rules: Check for previous version of llvm-spirv as well Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/rules | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index ae0f0704..73d6f099 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium * d/rules: Set LLVM_SPIRV with cmake for libclc * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV * d/rules: Restore building libclc .bc output without spir-v support + * d/rules: Check for previous version of llvm-spirv as well -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/rules b/debian/rules index f1179237..4d8a59c8 100755 --- a/debian/rules +++ b/debian/rules @@ -245,6 +245,10 @@ endif LLVM_SPIRV_VERSION := $(LLVM_VERSION) LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv-$(LLVM_SPIRV_VERSION)" 2>/dev/null) +ifndef LLVM_SPIRV + LLVM_SPIRV_VERSION := $(shell expr $(LLVM_VERSION) - 1) + LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv-$(LLVM_SPIRV_VERSION)" 2>/dev/null) +endif ifndef LLVM_SPIRV LLVM_SPIRV_INSTALLED = no From b7f42769ed5bcfc452793e128df6b0f0aa989b89 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sun, 30 Oct 2022 15:17:32 -0700 Subject: [PATCH 76/89] d/control: Add llvm-spirv-14 as an alternative to llvm-spirv-15 Signed-off-by: Jordan Justen --- debian/changelog | 1 + debian/control | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 73d6f099..8cb902ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV * d/rules: Restore building libclc .bc output without spir-v support * d/rules: Check for previous version of llvm-spirv as well + * d/control: Add llvm-spirv-14 as an alternative to llvm-spirv-15 -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 diff --git a/debian/control b/debian/control index 7df354bb..db82f765 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,8 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libctypes-ocaml-dev [amd64 arm64 armhf ppc64el riscv64 s390x], dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el riscv64 s390x], libpfm4-dev [linux-any], python3-setuptools, libz3-dev, - llvm-spirv-15 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], + llvm-spirv-15 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | + llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], From cdbc33a6e02fa8b73635e14f376c81668806a0d2 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:22:27 +0100 Subject: [PATCH 77/89] * New upstream release (Closes: #1023455) * Cherry-pick patches to fix the FTBFS with swig + lldb (Closes: #1023444) --- debian/changelog | 8 ++++++-- debian/patches/lldb-swig-2.diff | 13 +++++++++++++ debian/patches/lldb-swig.diff | 26 ++++++++++++++++++++++++++ debian/patches/series | 2 ++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 debian/patches/lldb-swig-2.diff create mode 100644 debian/patches/lldb-swig.diff diff --git a/debian/changelog b/debian/changelog index 8cb902ea..03058bca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium +llvm-toolchain-15 (1:15.0.4-1) unstable; urgency=medium [ Jordan Justen ] * d/rules: Rename LLVM_SPIR_VERSION to LLVM_SPIRV_VERSION @@ -10,7 +10,11 @@ llvm-toolchain-15 (1:15.0.3-3) UNRELEASED; urgency=medium * d/rules: Check for previous version of llvm-spirv as well * d/control: Add llvm-spirv-14 as an alternative to llvm-spirv-15 - -- Jordan Justen Sun, 30 Oct 2022 00:26:40 -0700 + [ Sylvestre Ledru ] + * New upstream release (Closes: #1023455) + * Cherry-pick patches to fix the FTBFS with swig + lldb (Closes: #1023444) + + -- Sylvestre Ledru Wed, 02 Nov 2022 08:50:23 +0100 llvm-toolchain-15 (1:15.0.3-2) unstable; urgency=medium diff --git a/debian/patches/lldb-swig-2.diff b/debian/patches/lldb-swig-2.diff new file mode 100644 index 00000000..54763838 --- /dev/null +++ b/debian/patches/lldb-swig-2.diff @@ -0,0 +1,13 @@ +diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig +index 203be803d2ebd..11f68d59ae7be 100644 +--- a/lldb/bindings/python/python-typemaps.swig ++++ b/lldb/bindings/python/python-typemaps.swig +@@ -435,7 +435,7 @@ template <> bool SetNumberFromPyObject(double &number, PyObject *obj) { + + %typemap(out) lldb::FileSP { + $result = nullptr; +- lldb::FileSP &sp = $1; ++ const lldb::FileSP &sp = $1; + if (sp) { + PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); + if (!pyfile.IsValid()) diff --git a/debian/patches/lldb-swig.diff b/debian/patches/lldb-swig.diff new file mode 100644 index 00000000..93b54528 --- /dev/null +++ b/debian/patches/lldb-swig.diff @@ -0,0 +1,26 @@ +diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt +index c8aa0bcf96817..9eed2f1e62999 100644 +--- a/lldb/bindings/CMakeLists.txt ++++ b/lldb/bindings/CMakeLists.txt +@@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS + -features autodoc + -I${LLDB_SOURCE_DIR}/include + -I${CMAKE_CURRENT_SOURCE_DIR} +- -D__STDC_LIMIT_MACROS +- -D__STDC_CONSTANT_MACROS + ${DARWIN_EXTRAS} + ) + +diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig +index fb75513a0df1b..d984711bbd8a2 100644 +--- a/lldb/bindings/interfaces.swig ++++ b/lldb/bindings/interfaces.swig +@@ -1,8 +1,5 @@ + /* Various liblldb typedefs that SWIG needs to know about. */ + #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ +-/* The ISO C99 standard specifies that in C++ implementations limit macros such +- as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ +-#define __STDC_LIMIT_MACROS + %include "stdint.i" + + %include "lldb/lldb-defines.h" diff --git a/debian/patches/series b/debian/patches/series index 3326826c..0ea41552 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -154,3 +154,5 @@ bolt.patch bolt-disable-emit-relocs.patch D124841-fix-powerpc-miscompile.patch mips/mips-assert-size.diff +lldb-swig.diff +lldb-swig-2.diff From 8409076b8f70a8c2ef844991b3eef7ba3a87294f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:33:17 +0100 Subject: [PATCH 78/89] move all lldb patches into the same dir --- debian/patches/lldb-libname.diff | 17 -------- debian/patches/lldb-soname.diff | 50 ---------------------- debian/patches/lldb-swig-2.diff | 13 ------ debian/patches/lldb-swig.diff | 26 ----------- debian/patches/print-lldb-path.patch | 16 ------- debian/patches/series | 10 ++--- debian/patches/test-disable-lldb-i386.diff | 26 ----------- 7 files changed, 5 insertions(+), 153 deletions(-) delete mode 100644 debian/patches/lldb-libname.diff delete mode 100644 debian/patches/lldb-soname.diff delete mode 100644 debian/patches/lldb-swig-2.diff delete mode 100644 debian/patches/lldb-swig.diff delete mode 100644 debian/patches/print-lldb-path.patch delete mode 100644 debian/patches/test-disable-lldb-i386.diff diff --git a/debian/patches/lldb-libname.diff b/debian/patches/lldb-libname.diff deleted file mode 100644 index feb99140..00000000 --- a/debian/patches/lldb-libname.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- - lldb/scripts/Python/finishSwigPythonLLDB.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: llvm-toolchain-snapshot_15~svn3315515/lldb/scripts/Python/finishSwigPythonLLDB.py -=================================================================== ---- llvm-toolchain-snapshot_15~svn3315515.orig/lldb/scripts/Python/finishSwigPythonLLDB.py -+++ llvm-toolchain-snapshot_15~svn3315515/lldb/scripts/Python/finishSwigPythonLLDB.py -@@ -443,7 +443,7 @@ def make_symlink_liblldb( - if eOSType == utilsOsType.EnumOsType.Darwin: - strLibFileExtn = ".dylib" - else: -- strLibFileExtn = ".so" -+ strLibFileExtn = "-15.so" - strSrc = os.path.join(vstrLldbLibDir, "liblldb" + strLibFileExtn) - - bOk, strErrMsg = make_symlink( diff --git a/debian/patches/lldb-soname.diff b/debian/patches/lldb-soname.diff deleted file mode 100644 index 363397be..00000000 --- a/debian/patches/lldb-soname.diff +++ /dev/null @@ -1,50 +0,0 @@ ---- - lldb/source/API/CMakeLists.txt | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -Index: llvm-toolchain-snapshot_14~++20220119063448+5fa826f4e284/lldb/source/API/CMakeLists.txt -=================================================================== ---- llvm-toolchain-snapshot_14~++20220119063448+5fa826f4e284.orig/lldb/source/API/CMakeLists.txt -+++ llvm-toolchain-snapshot_14~++20220119063448+5fa826f4e284/lldb/source/API/CMakeLists.txt -@@ -15,7 +15,12 @@ if(LLDB_ENABLE_LUA) - set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp) - endif() - --add_lldb_library(liblldb SHARED ${option_framework} -+set(output_name lldb) -+if (CMAKE_SYSTEM_NAME MATCHES "Windows") -+ set(output_name liblldb) -+endif() -+ -+add_lldb_library(liblldb SHARED OUTPUT_NAME ${output_name} SONAME - SBAddress.cpp - SBAttachInfo.cpp - SBBlock.cpp -@@ -158,7 +163,7 @@ endif() - - set_target_properties(liblldb - PROPERTIES -- VERSION ${LLDB_VERSION} -+ VERSION 1 - ) - - target_compile_definitions(liblldb PRIVATE LLDB_IN_LIBLLDB) -@@ -178,12 +183,12 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windo - set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc") - endif() - --if (NOT MSVC) -- set_target_properties(liblldb -- PROPERTIES -- OUTPUT_NAME lldb -- ) --endif() -+#if (NOT MSVC) -+# set_target_properties(liblldb -+# PROPERTIES -+# OUTPUT_NAME lldb -+# ) -+#endif() - - # The Clang expression parser in LLDB requires the Clang resource directory to function. - if (TARGET clang-resource-headers) diff --git a/debian/patches/lldb-swig-2.diff b/debian/patches/lldb-swig-2.diff deleted file mode 100644 index 54763838..00000000 --- a/debian/patches/lldb-swig-2.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig -index 203be803d2ebd..11f68d59ae7be 100644 ---- a/lldb/bindings/python/python-typemaps.swig -+++ b/lldb/bindings/python/python-typemaps.swig -@@ -435,7 +435,7 @@ template <> bool SetNumberFromPyObject(double &number, PyObject *obj) { - - %typemap(out) lldb::FileSP { - $result = nullptr; -- lldb::FileSP &sp = $1; -+ const lldb::FileSP &sp = $1; - if (sp) { - PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); - if (!pyfile.IsValid()) diff --git a/debian/patches/lldb-swig.diff b/debian/patches/lldb-swig.diff deleted file mode 100644 index 93b54528..00000000 --- a/debian/patches/lldb-swig.diff +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt -index c8aa0bcf96817..9eed2f1e62999 100644 ---- a/lldb/bindings/CMakeLists.txt -+++ b/lldb/bindings/CMakeLists.txt -@@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS - -features autodoc - -I${LLDB_SOURCE_DIR}/include - -I${CMAKE_CURRENT_SOURCE_DIR} -- -D__STDC_LIMIT_MACROS -- -D__STDC_CONSTANT_MACROS - ${DARWIN_EXTRAS} - ) - -diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig -index fb75513a0df1b..d984711bbd8a2 100644 ---- a/lldb/bindings/interfaces.swig -+++ b/lldb/bindings/interfaces.swig -@@ -1,8 +1,5 @@ - /* Various liblldb typedefs that SWIG needs to know about. */ - #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ --/* The ISO C99 standard specifies that in C++ implementations limit macros such -- as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ --#define __STDC_LIMIT_MACROS - %include "stdint.i" - - %include "lldb/lldb-defines.h" diff --git a/debian/patches/print-lldb-path.patch b/debian/patches/print-lldb-path.patch deleted file mode 100644 index 9d9d32cf..00000000 --- a/debian/patches/print-lldb-path.patch +++ /dev/null @@ -1,16 +0,0 @@ -Author: Gianfranco Costamagna -Last-Update: 2020-01-21 - -Index: llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp -=================================================================== ---- llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8.orig/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp -+++ llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp -@@ -239,6 +239,8 @@ void ScriptInterpreterPython::ComputePyt - // x86_64, or bin on Windows). - llvm::sys::path::remove_filename(path); - llvm::sys::path::append(path, LLDB_PYTHON_RELATIVE_LIBDIR); -+ // remove double "lib/lib" statement -+ std::replace(path.begin(), path.end(), '/lib/lib/', '/lib/'); - - #if defined(_WIN32) - // This will be injected directly through FileSpec.GetDirectory().SetString(), diff --git a/debian/patches/series b/debian/patches/series index 0ea41552..a748d53e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -27,7 +27,7 @@ disable-display-PASS-UNSUPPORTED-XFAIL.diff # Lib names 0044-soname.diff -lldb-soname.diff +lldb/lldb-soname.diff #lldb-libname.diff openmp-soname.diff @@ -122,12 +122,12 @@ bootstrap-fix-include-next.diff #D67877-cmake-clang-example.patch python3-shebang.patch -print-lldb-path.patch +lldb/print-lldb-path.patch lower-python-dep.diff scan-build-py-fix-default-bin.diff omp-riscv64.patch -test-disable-lldb-i386.diff +lldb/test-disable-lldb-i386.diff unbreak-atomic-mips.diff llvm-fix-lld-linker-check.diff openmp-fix-runtimes-build.diff @@ -154,5 +154,5 @@ bolt.patch bolt-disable-emit-relocs.patch D124841-fix-powerpc-miscompile.patch mips/mips-assert-size.diff -lldb-swig.diff -lldb-swig-2.diff +lldb/lldb-swig.diff +lldb/lldb-swig-2.diff diff --git a/debian/patches/test-disable-lldb-i386.diff b/debian/patches/test-disable-lldb-i386.diff deleted file mode 100644 index 088f937d..00000000 --- a/debian/patches/test-disable-lldb-i386.diff +++ /dev/null @@ -1,26 +0,0 @@ -Index: llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb.c -=================================================================== ---- llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62.orig/integration-test-suite/tests/basic_lldb.c -+++ llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb.c -@@ -1,7 +1,7 @@ - // RUN: %clang -g -o %t %s - // RUN: %lldb -s %S/basic_lldb.in %t | grep "main at basic_lldb.c:" - // REQUIRES: lldb, clang --// XFAIL: ppc64 -+// XFAIL: ppc64, i686, i386 - - int main() { - int a=0; -Index: llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb2.cpp -=================================================================== ---- llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62.orig/integration-test-suite/tests/basic_lldb2.cpp -+++ llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb2.cpp -@@ -1,7 +1,7 @@ - // RUN: %clangxx -g -o %t %s - // RUN: %lldb -s %S/basic_lldb2.in %t | grep "stop reason = step over" - // REQUIRES: lldb, clangxx --// XFAIL: ppc64 -+// XFAIL: ppc64, i686, i386 - - #include - int main (void) From e3106b14e1da1af83b54b86e79908224770aa428 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:34:41 +0100 Subject: [PATCH 79/89] add back lldb pacthes --- debian/patches/lldb/lldb-libname.diff | 17 +++++++ debian/patches/lldb/lldb-soname.diff | 50 +++++++++++++++++++ debian/patches/lldb/lldb-swig-2.diff | 13 +++++ debian/patches/lldb/lldb-swig.diff | 26 ++++++++++ debian/patches/lldb/print-lldb-path.patch | 16 ++++++ .../patches/lldb/test-disable-lldb-i386.diff | 26 ++++++++++ 6 files changed, 148 insertions(+) create mode 100644 debian/patches/lldb/lldb-libname.diff create mode 100644 debian/patches/lldb/lldb-soname.diff create mode 100644 debian/patches/lldb/lldb-swig-2.diff create mode 100644 debian/patches/lldb/lldb-swig.diff create mode 100644 debian/patches/lldb/print-lldb-path.patch create mode 100644 debian/patches/lldb/test-disable-lldb-i386.diff diff --git a/debian/patches/lldb/lldb-libname.diff b/debian/patches/lldb/lldb-libname.diff new file mode 100644 index 00000000..feb99140 --- /dev/null +++ b/debian/patches/lldb/lldb-libname.diff @@ -0,0 +1,17 @@ +--- + lldb/scripts/Python/finishSwigPythonLLDB.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: llvm-toolchain-snapshot_15~svn3315515/lldb/scripts/Python/finishSwigPythonLLDB.py +=================================================================== +--- llvm-toolchain-snapshot_15~svn3315515.orig/lldb/scripts/Python/finishSwigPythonLLDB.py ++++ llvm-toolchain-snapshot_15~svn3315515/lldb/scripts/Python/finishSwigPythonLLDB.py +@@ -443,7 +443,7 @@ def make_symlink_liblldb( + if eOSType == utilsOsType.EnumOsType.Darwin: + strLibFileExtn = ".dylib" + else: +- strLibFileExtn = ".so" ++ strLibFileExtn = "-15.so" + strSrc = os.path.join(vstrLldbLibDir, "liblldb" + strLibFileExtn) + + bOk, strErrMsg = make_symlink( diff --git a/debian/patches/lldb/lldb-soname.diff b/debian/patches/lldb/lldb-soname.diff new file mode 100644 index 00000000..363397be --- /dev/null +++ b/debian/patches/lldb/lldb-soname.diff @@ -0,0 +1,50 @@ +--- + lldb/source/API/CMakeLists.txt | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +Index: llvm-toolchain-snapshot_14~++20220119063448+5fa826f4e284/lldb/source/API/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20220119063448+5fa826f4e284.orig/lldb/source/API/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20220119063448+5fa826f4e284/lldb/source/API/CMakeLists.txt +@@ -15,7 +15,12 @@ if(LLDB_ENABLE_LUA) + set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp) + endif() + +-add_lldb_library(liblldb SHARED ${option_framework} ++set(output_name lldb) ++if (CMAKE_SYSTEM_NAME MATCHES "Windows") ++ set(output_name liblldb) ++endif() ++ ++add_lldb_library(liblldb SHARED OUTPUT_NAME ${output_name} SONAME + SBAddress.cpp + SBAttachInfo.cpp + SBBlock.cpp +@@ -158,7 +163,7 @@ endif() + + set_target_properties(liblldb + PROPERTIES +- VERSION ${LLDB_VERSION} ++ VERSION 1 + ) + + target_compile_definitions(liblldb PRIVATE LLDB_IN_LIBLLDB) +@@ -178,12 +183,12 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windo + set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc") + endif() + +-if (NOT MSVC) +- set_target_properties(liblldb +- PROPERTIES +- OUTPUT_NAME lldb +- ) +-endif() ++#if (NOT MSVC) ++# set_target_properties(liblldb ++# PROPERTIES ++# OUTPUT_NAME lldb ++# ) ++#endif() + + # The Clang expression parser in LLDB requires the Clang resource directory to function. + if (TARGET clang-resource-headers) diff --git a/debian/patches/lldb/lldb-swig-2.diff b/debian/patches/lldb/lldb-swig-2.diff new file mode 100644 index 00000000..54763838 --- /dev/null +++ b/debian/patches/lldb/lldb-swig-2.diff @@ -0,0 +1,13 @@ +diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig +index 203be803d2ebd..11f68d59ae7be 100644 +--- a/lldb/bindings/python/python-typemaps.swig ++++ b/lldb/bindings/python/python-typemaps.swig +@@ -435,7 +435,7 @@ template <> bool SetNumberFromPyObject(double &number, PyObject *obj) { + + %typemap(out) lldb::FileSP { + $result = nullptr; +- lldb::FileSP &sp = $1; ++ const lldb::FileSP &sp = $1; + if (sp) { + PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); + if (!pyfile.IsValid()) diff --git a/debian/patches/lldb/lldb-swig.diff b/debian/patches/lldb/lldb-swig.diff new file mode 100644 index 00000000..93b54528 --- /dev/null +++ b/debian/patches/lldb/lldb-swig.diff @@ -0,0 +1,26 @@ +diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt +index c8aa0bcf96817..9eed2f1e62999 100644 +--- a/lldb/bindings/CMakeLists.txt ++++ b/lldb/bindings/CMakeLists.txt +@@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS + -features autodoc + -I${LLDB_SOURCE_DIR}/include + -I${CMAKE_CURRENT_SOURCE_DIR} +- -D__STDC_LIMIT_MACROS +- -D__STDC_CONSTANT_MACROS + ${DARWIN_EXTRAS} + ) + +diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig +index fb75513a0df1b..d984711bbd8a2 100644 +--- a/lldb/bindings/interfaces.swig ++++ b/lldb/bindings/interfaces.swig +@@ -1,8 +1,5 @@ + /* Various liblldb typedefs that SWIG needs to know about. */ + #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ +-/* The ISO C99 standard specifies that in C++ implementations limit macros such +- as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ +-#define __STDC_LIMIT_MACROS + %include "stdint.i" + + %include "lldb/lldb-defines.h" diff --git a/debian/patches/lldb/print-lldb-path.patch b/debian/patches/lldb/print-lldb-path.patch new file mode 100644 index 00000000..9d9d32cf --- /dev/null +++ b/debian/patches/lldb/print-lldb-path.patch @@ -0,0 +1,16 @@ +Author: Gianfranco Costamagna +Last-Update: 2020-01-21 + +Index: llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +=================================================================== +--- llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8.orig/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp ++++ llvm-toolchain-snapshot_15~++20220724113059+7feab85df8e8/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +@@ -239,6 +239,8 @@ void ScriptInterpreterPython::ComputePyt + // x86_64, or bin on Windows). + llvm::sys::path::remove_filename(path); + llvm::sys::path::append(path, LLDB_PYTHON_RELATIVE_LIBDIR); ++ // remove double "lib/lib" statement ++ std::replace(path.begin(), path.end(), '/lib/lib/', '/lib/'); + + #if defined(_WIN32) + // This will be injected directly through FileSpec.GetDirectory().SetString(), diff --git a/debian/patches/lldb/test-disable-lldb-i386.diff b/debian/patches/lldb/test-disable-lldb-i386.diff new file mode 100644 index 00000000..088f937d --- /dev/null +++ b/debian/patches/lldb/test-disable-lldb-i386.diff @@ -0,0 +1,26 @@ +Index: llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb.c +=================================================================== +--- llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62.orig/integration-test-suite/tests/basic_lldb.c ++++ llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb.c +@@ -1,7 +1,7 @@ + // RUN: %clang -g -o %t %s + // RUN: %lldb -s %S/basic_lldb.in %t | grep "main at basic_lldb.c:" + // REQUIRES: lldb, clang +-// XFAIL: ppc64 ++// XFAIL: ppc64, i686, i386 + + int main() { + int a=0; +Index: llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb2.cpp +=================================================================== +--- llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62.orig/integration-test-suite/tests/basic_lldb2.cpp ++++ llvm-toolchain-snapshot_15~++20220510103135+63865e1fce62/integration-test-suite/tests/basic_lldb2.cpp +@@ -1,7 +1,7 @@ + // RUN: %clangxx -g -o %t %s + // RUN: %lldb -s %S/basic_lldb2.in %t | grep "stop reason = step over" + // REQUIRES: lldb, clangxx +-// XFAIL: ppc64 ++// XFAIL: ppc64, i686, i386 + + #include + int main (void) From 2d8ec664cee381b8c938ea917e78936de8abec42 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:36:34 +0100 Subject: [PATCH 80/89] move the lldb patches into a lldb dir --- debian/patches/{ => lldb}/lldb-libname.diff | 0 debian/patches/{ => lldb}/lldb-soname.diff | 0 debian/patches/{ => lldb}/print-lldb-path.patch | 0 debian/patches/{ => lldb}/test-disable-lldb-i386.diff | 0 debian/patches/series | 8 +++++--- 5 files changed, 5 insertions(+), 3 deletions(-) rename debian/patches/{ => lldb}/lldb-libname.diff (100%) rename debian/patches/{ => lldb}/lldb-soname.diff (100%) rename debian/patches/{ => lldb}/print-lldb-path.patch (100%) rename debian/patches/{ => lldb}/test-disable-lldb-i386.diff (100%) diff --git a/debian/patches/lldb-libname.diff b/debian/patches/lldb/lldb-libname.diff similarity index 100% rename from debian/patches/lldb-libname.diff rename to debian/patches/lldb/lldb-libname.diff diff --git a/debian/patches/lldb-soname.diff b/debian/patches/lldb/lldb-soname.diff similarity index 100% rename from debian/patches/lldb-soname.diff rename to debian/patches/lldb/lldb-soname.diff diff --git a/debian/patches/print-lldb-path.patch b/debian/patches/lldb/print-lldb-path.patch similarity index 100% rename from debian/patches/print-lldb-path.patch rename to debian/patches/lldb/print-lldb-path.patch diff --git a/debian/patches/test-disable-lldb-i386.diff b/debian/patches/lldb/test-disable-lldb-i386.diff similarity index 100% rename from debian/patches/test-disable-lldb-i386.diff rename to debian/patches/lldb/test-disable-lldb-i386.diff diff --git a/debian/patches/series b/debian/patches/series index a2fe91ba..1d83b5f0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -28,7 +28,7 @@ disable-display-PASS-UNSUPPORTED-XFAIL.diff # Lib names 0044-soname.diff -lldb-soname.diff +lldb/lldb-soname.diff #lldb-libname.diff openmp-soname.diff @@ -131,12 +131,12 @@ D98575.patch x86-fuzzer.patch python3-shebang.patch -print-lldb-path.patch +lldb/print-lldb-path.patch lower-python-dep.diff scan-build-py-fix-default-bin.diff omp-riscv64.patch -test-disable-lldb-i386.diff +lldb/test-disable-lldb-i386.diff unbreak-atomic-mips.diff llvm-fix-lld-linker-check.diff openmp-fix-runtimes-build.diff @@ -159,3 +159,5 @@ revert-update-doc.diff fix-typo.diff ubuntu-kinetic.patch fix-typo-1018770.diff +lldb/lldb-swig.diff +lldb/lldb-swig-2.diff From cb901ad96190e598a9a3ef7ff203a6ef9a10dfec Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:36:47 +0100 Subject: [PATCH 81/89] add lldb swig patches --- debian/patches/lldb/lldb-swig-2.diff | 13 +++++++++++++ debian/patches/lldb/lldb-swig.diff | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 debian/patches/lldb/lldb-swig-2.diff create mode 100644 debian/patches/lldb/lldb-swig.diff diff --git a/debian/patches/lldb/lldb-swig-2.diff b/debian/patches/lldb/lldb-swig-2.diff new file mode 100644 index 00000000..54763838 --- /dev/null +++ b/debian/patches/lldb/lldb-swig-2.diff @@ -0,0 +1,13 @@ +diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig +index 203be803d2ebd..11f68d59ae7be 100644 +--- a/lldb/bindings/python/python-typemaps.swig ++++ b/lldb/bindings/python/python-typemaps.swig +@@ -435,7 +435,7 @@ template <> bool SetNumberFromPyObject(double &number, PyObject *obj) { + + %typemap(out) lldb::FileSP { + $result = nullptr; +- lldb::FileSP &sp = $1; ++ const lldb::FileSP &sp = $1; + if (sp) { + PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); + if (!pyfile.IsValid()) diff --git a/debian/patches/lldb/lldb-swig.diff b/debian/patches/lldb/lldb-swig.diff new file mode 100644 index 00000000..93b54528 --- /dev/null +++ b/debian/patches/lldb/lldb-swig.diff @@ -0,0 +1,26 @@ +diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt +index c8aa0bcf96817..9eed2f1e62999 100644 +--- a/lldb/bindings/CMakeLists.txt ++++ b/lldb/bindings/CMakeLists.txt +@@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS + -features autodoc + -I${LLDB_SOURCE_DIR}/include + -I${CMAKE_CURRENT_SOURCE_DIR} +- -D__STDC_LIMIT_MACROS +- -D__STDC_CONSTANT_MACROS + ${DARWIN_EXTRAS} + ) + +diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig +index fb75513a0df1b..d984711bbd8a2 100644 +--- a/lldb/bindings/interfaces.swig ++++ b/lldb/bindings/interfaces.swig +@@ -1,8 +1,5 @@ + /* Various liblldb typedefs that SWIG needs to know about. */ + #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ +-/* The ISO C99 standard specifies that in C++ implementations limit macros such +- as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ +-#define __STDC_LIMIT_MACROS + %include "stdint.i" + + %include "lldb/lldb-defines.h" From 875efbd5ba309fb19e9af6583970f790f7c21844 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:37:32 +0100 Subject: [PATCH 82/89] Fix the lldb swig issues (closes: #1023444) --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 34ac6159..209c262a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-8) UNRELEASED; urgency=medium + + * Fix the lldb swig issues (closes: #1023444) + + -- Sylvestre Ledru Fri, 04 Nov 2022 19:36:56 +0100 + llvm-toolchain-14 (1:14.0.6-7) unstable; urgency=medium * Disable the cmake search for all binaries From 1e3332f2bf0d95400f8b17c7d5d17a2a3302ce80 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 4 Nov 2022 19:44:02 +0100 Subject: [PATCH 83/89] fix version --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 209c262a..998bddf7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-14 (1:14.0.6-8) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-8) unstable; urgency=medium * Fix the lldb swig issues (closes: #1023444) From ef8fc8008868f4420bc0ac0175f20d54a53a6c7d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 10 Nov 2022 12:23:06 +0100 Subject: [PATCH 84/89] remove non applied patch --- .../remove-trailing-space-version.diff | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 debian/patches/remove-trailing-space-version.diff diff --git a/debian/patches/remove-trailing-space-version.diff b/debian/patches/remove-trailing-space-version.diff deleted file mode 100644 index fadcf7f7..00000000 --- a/debian/patches/remove-trailing-space-version.diff +++ /dev/null @@ -1,34 +0,0 @@ -Index: llvm-toolchain-10_10.0.1~+rc1/clang/lib/Basic/Version.cpp -=================================================================== ---- llvm-toolchain-10_10.0.1~+rc1.orig/clang/lib/Basic/Version.cpp -+++ llvm-toolchain-10_10.0.1~+rc1/clang/lib/Basic/Version.cpp -@@ -125,8 +125,12 @@ std::string getClangToolFullVersion(Stri - #ifdef CLANG_VENDOR - OS << CLANG_VENDOR; - #endif -- OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION " " -- << getClangFullRepositoryVersion(); -+ OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION; -+ -+ std::string repo = getClangFullRepositoryVersion(); -+ if (!repo.empty()) { -+ OS << " " << repo; -+ } - - return OS.str(); - } -@@ -139,7 +143,13 @@ std::string getClangFullCPPVersion() { - #ifdef CLANG_VENDOR - OS << CLANG_VENDOR; - #endif -- OS << "Clang " CLANG_VERSION_STRING " " << getClangFullRepositoryVersion(); -+ OS << "Clang " CLANG_VERSION_STRING; -+ -+ std::string repo = getClangFullRepositoryVersion(); -+ if (!repo.empty()) { -+ OS << " " << repo; -+ } -+ - return OS.str(); - } - From 63341e11a5f046da87c38981db7e3f4b47a48260 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 10 Nov 2022 12:23:56 +0100 Subject: [PATCH 85/89] remove an old gcc 4.9 workaround --- debian/rules | 5 ----- 1 file changed, 5 deletions(-) diff --git a/debian/rules b/debian/rules index c69afcc7..8eab97a9 100755 --- a/debian/rules +++ b/debian/rules @@ -103,11 +103,6 @@ ifneq (,$(filter $(DEB_HOST_ARCH),i386 hurd-i386 kfreebsd-i386 armel mipsel powe LDFLAGS_EXTRA += -latomic endif -ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 4.9-20140411-1~ ; echo $$?),0) -# Too old version of gcc. Force 4.9 - GCC_VERSION := 4.9 -endif - Z3_FLAG = -DLLVM_ENABLE_Z3_SOLVER=OFF ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' libz3-dev) gt 4.7.0; echo $$?),0) # no ocaml support in main for Ubuntu From 3270880abdc0788cc2b2c76f45322104c7297a2d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 10 Nov 2022 15:19:49 +0100 Subject: [PATCH 86/89] We want to set the clang extra version ONLY in stage 2 because we want the clang stage 1 to be as reproducible as possible when building with sccache (because this tool do a hash using the compiler binary and other things) --- debian/rules | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/rules b/debian/rules index 8eab97a9..f6cfbb0f 100755 --- a/debian/rules +++ b/debian/rules @@ -92,6 +92,12 @@ COMPILER_RT_USE_BUILTINS_LIBRARY := ON LIBCXX_EXCEPTIONS := ON LIBCXX_USE_COMPILER_RT := ON +# We want to set the clang extra version ONLY in stage 2 +# because we want the clang stage 1 to be as reproducible as possible +# when building with sccache (because this tool do a hash using the +# compiler binary and other things) +STAGE_2_CMAKE_EXTRA += -DCLANG_REPOSITORY_STRING=$(DEBIAN_REVISION) + ifneq (,$(filter $(DEB_HOST_ARCH),sparc sparc64)) STAGE_1_CMAKE_EXTRA += -DLLVM_PARALLEL_LINK_JOBS=4 endif @@ -523,9 +529,6 @@ override_dh_auto_configure: preconfigure $(CC) -v $(CXX) -v mkdir -p $(TARGET_BUILD) - mkdir -p clang/include/clang/Debian - sed -e "s|@DEB_PATCHSETVERSION@|$(DEBIAN_REVISION)|" \ - debian/debian_path.h > clang/include/clang/Debian/debian_path.h if test "$(SCAN_BUILD)" = "yes"; then \ patch -f -p1 < debian/patches/on-the-fly/use-scan-build-runtimes.diff||true; \ fi @@ -1171,7 +1174,7 @@ override_dh_gencontrol: override_dh_auto_clean: - rm -rf $(TARGET_BUILD) tools/clang/include/clang/Debian/debian_path.h llvm/docs/_build/ clang/docs/_build tools/clang/docs/_html/ + rm -rf $(TARGET_BUILD) llvm/docs/_build/ clang/docs/_build tools/clang/docs/_html/ # QA tools rm -rf cov-int/ reports/ rm -f `ls debian/*.in|sed -e "s|.in$$||g"` From 9ea3878d01abb0224522c5cf9c34584bdf9fd4ba Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 10 Nov 2022 15:21:18 +0100 Subject: [PATCH 87/89] use the upstream option to set the option --- debian/patches/19-clang_debian_version.patch | 21 -------------------- debian/patches/series | 1 - 2 files changed, 22 deletions(-) delete mode 100644 debian/patches/19-clang_debian_version.patch diff --git a/debian/patches/19-clang_debian_version.patch b/debian/patches/19-clang_debian_version.patch deleted file mode 100644 index 89ac6bdc..00000000 --- a/debian/patches/19-clang_debian_version.patch +++ /dev/null @@ -1,21 +0,0 @@ -Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/clang/lib/Basic/Version.cpp -=================================================================== ---- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/clang/lib/Basic/Version.cpp -+++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/clang/lib/Basic/Version.cpp -@@ -14,6 +14,7 @@ - #include "clang/Basic/LLVM.h" - #include "clang/Config/config.h" - #include "llvm/Support/raw_ostream.h" -+#include "clang/Debian/debian_path.h" - #include - #include - -@@ -95,7 +96,7 @@ std::string getClangToolFullVersion(Stri - #ifdef CLANG_VENDOR - OS << CLANG_VENDOR; - #endif -- OS << ToolName << " version " CLANG_VERSION_STRING; -+ OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION; - - std::string repo = getClangFullRepositoryVersion(); - if (!repo.empty()) { diff --git a/debian/patches/series b/debian/patches/series index 1d83b5f0..58e159af 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,4 @@ # Debian versions -19-clang_debian_version.patch 0003-Debian-version-info-and-bugreport.patch clang-format-version.diff clang-analyzer-force-version.diff From e9022e33bc7dcce84eb6745d1483aab65c514ea7 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 10 Nov 2022 16:17:42 +0100 Subject: [PATCH 88/89] remove old an old and useless patch --- ...03-Debian-version-info-and-bugreport.patch | 19 ------------------- debian/patches/series | 1 - 2 files changed, 20 deletions(-) delete mode 100644 debian/patches/0003-Debian-version-info-and-bugreport.patch diff --git a/debian/patches/0003-Debian-version-info-and-bugreport.patch b/debian/patches/0003-Debian-version-info-and-bugreport.patch deleted file mode 100644 index 0de4a206..00000000 --- a/debian/patches/0003-Debian-version-info-and-bugreport.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- - lib/Support/CommandLine.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -Index: llvm-toolchain-snapshot_14~++20210910110407+146ec74a8382/llvm/lib/Support/CommandLine.cpp -=================================================================== ---- llvm-toolchain-snapshot_14~++20210910110407+146ec74a8382.orig/llvm/lib/Support/CommandLine.cpp -+++ llvm-toolchain-snapshot_14~++20210910110407+146ec74a8382/llvm/lib/Support/CommandLine.cpp -@@ -2423,6 +2423,10 @@ public: - OS << " " << LLVM_VERSION_INFO; - #endif - OS << "\n "; -+#ifdef LLVM_DEBIAN_INFO -+ OS << LLVM_DEBIAN_INFO; -+#endif -+ OS << "\n "; - #if LLVM_IS_DEBUG_BUILD - OS << "DEBUG build"; - #else diff --git a/debian/patches/series b/debian/patches/series index 58e159af..5852e004 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,4 @@ # Debian versions -0003-Debian-version-info-and-bugreport.patch clang-format-version.diff clang-analyzer-force-version.diff From 98697f3cf1a90026401438acc052456181bb178d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 11 Nov 2022 08:45:08 +0100 Subject: [PATCH 89/89] remove the sccache log dump --- debian/rules | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/rules b/debian/rules index c84b119c..edad3011 100755 --- a/debian/rules +++ b/debian/rules @@ -782,7 +782,6 @@ sccache-stats: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ - cat /opt/sccache/sccache.log; \ /opt/sccache/sccache --show-stats; \ fi touch $@