From e65cd4e1134cc07b4cf3b4299586b2ca354c8b18 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 6 Sep 2023 22:44:48 +0200 Subject: [PATCH 1/8] Strip -fcf-protection for wasm build - new flag added in dpkg 1.22 --- debian/changelog | 6 ++++++ debian/rules | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3e8ac9a3..02a06598 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-17 (1:17.0.0~+rc4-1~exp2) experimental; urgency=medium + + * Strip -fcf-protection for wasm build - new flag added in dpkg 1.22 + + -- Sylvestre Ledru Wed, 06 Sep 2023 22:44:15 +0200 + llvm-toolchain-16 (1:16.0.6-13) UNRELEASED; urgency=medium * Also runtime-depend on {libzstd,zlib1g}-dev, from Paravoid (Closes: diff --git a/debian/rules b/debian/rules index 6f4a607a..b9b1eb73 100755 --- a/debian/rules +++ b/debian/rules @@ -787,6 +787,10 @@ ifndef LLVM_SPIRV endif touch $@ +# Remove some new flags introduced by dpkg 1.22.0; +STAGE_2_WASM_CFLAGS := $(shell echo $(STAGE_2_CFLAGS) | sed -e "s/-fcf-protection//g") +STAGE_2_WASM_CXXFLAGS := $(shell echo $(STAGE_2_CXXFLAGS) | sed -e "s/-fcf-protection//g") + build-wasm/compiler-rt-%: cpu = $(@:build-wasm/compiler-rt-%=%) build-wasm/compiler-rt-%: @echo "Building compiler-rt for $(cpu)" @@ -801,8 +805,8 @@ build-wasm/compiler-rt-%: -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-unknown \ -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ - -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \ - -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS)" \ + -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_WASM_CFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_WASM_CXXFLAGS)" \ -DCMAKE_SHARED_LINKER_FLAGS="$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ -DCMAKE_MODULE_LINKER_FLAGS="$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ -DCMAKE_EXE_LINKER_FLAGS="$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ From fdc9045b3777227723ea34f8b23f035aceaaf459 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 7 Sep 2023 13:01:27 +0200 Subject: [PATCH 2/8] Strip -fcf-protection for wasm build - new flag added in dpkg 1.22 --- debian/changelog | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 02a06598..a24d7cd0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,15 +1,13 @@ -llvm-toolchain-17 (1:17.0.0~+rc4-1~exp2) experimental; urgency=medium - - * Strip -fcf-protection for wasm build - new flag added in dpkg 1.22 - - -- Sylvestre Ledru Wed, 06 Sep 2023 22:44:15 +0200 - llvm-toolchain-16 (1:16.0.6-13) UNRELEASED; urgency=medium + [ Gianfranco Costamagna ] * Also runtime-depend on {libzstd,zlib1g}-dev, from Paravoid (Closes: #1047718) - -- Gianfranco Costamagna Thu, 07 Sep 2023 01:43:23 +0200 + [ Sylvestre Ledru ] + * Strip -fcf-protection for wasm build - new flag added in dpkg 1.22 + + -- Sylvestre Ledru Thu, 07 Sep 2023 13:01:14 +0200 llvm-toolchain-16 (1:16.0.6-12) unstable; urgency=medium From 69846b07a573e40e4b65671c4c0095b225ac67f4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 7 Sep 2023 13:42:36 +0200 Subject: [PATCH 3/8] prepare upload --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a24d7cd0..b2203589 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-16 (1:16.0.6-13) UNRELEASED; urgency=medium +llvm-toolchain-16 (1:16.0.6-13) unstable; urgency=medium [ Gianfranco Costamagna ] * Also runtime-depend on {libzstd,zlib1g}-dev, from Paravoid (Closes: From 26dacf93c21084717783d4b489836ae8d88c4071 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 7 Sep 2023 17:30:19 +0200 Subject: [PATCH 4/8] also apply the wasm build fix --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index b9b1eb73..da261197 100755 --- a/debian/rules +++ b/debian/rules @@ -869,8 +869,8 @@ build-wasm/libcxx-%-wasi: build-wasm/compiler-rt-% -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ -DCMAKE_AR=$(STAGE_2_BIN_DIR)/llvm-ar \ -DCMAKE_RANLIB=$(STAGE_2_BIN_DIR)/llvm-ranlib \ - -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS) -fno-stack-protector" \ - -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS) -fno-stack-protector" \ + -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_WASM_CFLAGS) -fno-stack-protector" \ + -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_WASM_CXXFLAGS) -fno-stack-protector" \ -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ From 7d266ab1bf05bf8527b80ab4d274ccd8d1898225 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 7 Sep 2023 23:03:57 +0200 Subject: [PATCH 5/8] Update control file --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index ca2eea7b..a8673fbc 100644 --- a/debian/control +++ b/debian/control @@ -934,7 +934,7 @@ Package: flang-17 # no 32bit support # https://github.com/llvm/llvm-project/issues/59845 Architecture: amd64 arm64 mips64el ppc64el kfreebsd-amd64 ppc64 sparc64 riscv64 -Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, libflang-16-dev (= ${binary:Version}), +Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, libflang-17-dev (= ${binary:Version}), Provides: fortran-compiler, gfortran-mod-15 Description: Fortran compiler Ground-up implementation of a Fortran front end written in From d2910da585491513f6a343cce17374c8b0c48673 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 7 Sep 2023 23:06:13 +0200 Subject: [PATCH 6/8] Upload to experimental --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index a03eff12..bf0f98bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-17 (1:17.0.0~+rc4-1~exp3) experimental; urgency=medium + + * Update control file + * Fixup build failures from 16 branch + + -- Gianfranco Costamagna Thu, 07 Sep 2023 23:04:28 +0200 + llvm-toolchain-17 (1:17.0.0~+rc4-1~exp2) experimental; urgency=medium * Strip -fcf-protection for wasm build - new flag added in dpkg 1.22 From a9459c0b9511fb6c76a9a188b3673131a37b9c15 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 8 Sep 2023 13:49:42 +0200 Subject: [PATCH 7/8] Also ignore "-mbranch-protection=standard" (used on arm64) --- debian/changelog | 6 ++++++ debian/rules | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bf0f98bd..248eefad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-17 (1:17.0.0~+rc4-1~exp4) experimental; urgency=medium + + * Also ignore "-mbranch-protection=standard" (used on arm64) + + -- Sylvestre Ledru Fri, 08 Sep 2023 13:49:38 +0200 + llvm-toolchain-17 (1:17.0.0~+rc4-1~exp3) experimental; urgency=medium * Update control file diff --git a/debian/rules b/debian/rules index 00c4d358..9b6e8def 100755 --- a/debian/rules +++ b/debian/rules @@ -815,8 +815,8 @@ endif touch $@ # Remove some new flags introduced by dpkg 1.22.0; -STAGE_2_WASM_CFLAGS := $(shell echo $(STAGE_2_CFLAGS) | sed -e "s/-fcf-protection//g") -STAGE_2_WASM_CXXFLAGS := $(shell echo $(STAGE_2_CXXFLAGS) | sed -e "s/-fcf-protection//g") +STAGE_2_WASM_CFLAGS := $(shell echo $(STAGE_2_CFLAGS) | sed -e "s/-fcf-protection//g" -e "s/-mbranch-protection=standard//g") +STAGE_2_WASM_CXXFLAGS := $(shell echo $(STAGE_2_CXXFLAGS) | sed -e "s/-fcf-protection//g" -e "s/-mbranch-protection=standard//g") build-wasm/compiler-rt-%: cpu = $(@:build-wasm/compiler-rt-%=%) build-wasm/compiler-rt-%: From 27b9a9bc59ac4e6bc1225df5f73b7901f5aed3c7 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 8 Sep 2023 17:26:39 +0200 Subject: [PATCH 8/8] On bionic & buster, for apt.llvm.org, pass -DLLVM_ENABLE_ZSTD=OFF as libzstd is too old --- debian/changelog | 7 +++++++ debian/rules | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index b2203589..3a4ea10a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-16 (1:16.0.6-14) UNRELEASED; urgency=medium + + * On bionic & buster, for apt.llvm.org, pass -DLLVM_ENABLE_ZSTD=OFF + as libzstd is too old + + -- Sylvestre Ledru Fri, 08 Sep 2023 17:26:20 +0200 + llvm-toolchain-16 (1:16.0.6-13) unstable; urgency=medium [ Gianfranco Costamagna ] diff --git a/debian/rules b/debian/rules index da261197..6cb1ab63 100755 --- a/debian/rules +++ b/debian/rules @@ -423,6 +423,12 @@ ifneq (,$(filter $(DEB_HOST_ARCH_OS),linux)) STAGE_2_CMAKE_EXTRA += -DLLVM_USE_PERF=ON -DLLVM_ENABLE_LIBPFM=ON endif +LLVM_ENABLE_ZSTD_DISABLE_DISTRO := bionic buster +# Disable zstd on old distro, fails on lld +ifeq (,$(filter-out $(LLVM_ENABLE_ZSTD_DISABLE_DISTRO), $(DISTRO))) + STAGE_ALL_CMAKE_EXTRA += -DLLVM_ENABLE_ZSTD=OFF +endif + LTO_ENABLE=no # Only enable it for archs supporting gold ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_GOLD_ARCHS)))