From 738814be417afcc85fc365d451fb3f44dcb284c7 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Thu, 9 Nov 2023 09:57:13 +0100 Subject: [PATCH 01/13] Don't run chrpath for libclang on sparc and sparc64 --- debian/changelog | 3 +++ debian/rules | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index deaa92ac..0d1f3df8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ llvm-toolchain-16 (1:16.0.6-18) UNRELEASED; urgency=medium [ Steve Langasek ] * Add noble as supported Ubuntu release + [ John Paul Adrian Glaubitz ] + * Don't run chrpath for libclang on sparc and sparc64 + -- Gianfranco Costamagna Wed, 25 Oct 2023 08:10:35 +0200 llvm-toolchain-16 (1:16.0.6-17exp1) experimental; urgency=medium diff --git a/debian/rules b/debian/rules index 60fa1d20..ef61242b 100755 --- a/debian/rules +++ b/debian/rules @@ -1024,7 +1024,7 @@ override_dh_auto_install: # Only run on executable, not script chrpath -d `find $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable -exec file -i '{}' \; | grep 'x-executable; charset=binary'|cut -d: -f1` -ifeq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe)) +ifeq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe sparc sparc64)) ifneq (,$(filter $(DEB_HOST_ARCH_OS),linux)) # To fix custom-library-search-path chrpath -d $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)*/lib/linux/*.so From fecd5d216d993a92c8eac41c7a02a4270cab6de6 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Thu, 9 Nov 2023 10:08:32 +0100 Subject: [PATCH 02/13] Don't run chrpath for libclang on sparc and sparc64 --- debian/changelog | 7 +++++++ debian/rules | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 26f668e5..576bcd1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-17 (1:17.0.4-2) UNRELEASED; urgency=medium + + [ John Paul Adrian Glaubitz ] + * Don't run chrpath for libclang on sparc and sparc64 + + -- John Paul Adrian Glaubitz Thu, 09 Nov 2023 10:07:49 +0100 + llvm-toolchain-17 (1:17.0.4-1) unstable; urgency=medium [ Matthias Klose ] diff --git a/debian/rules b/debian/rules index cb65d3f9..e9e93a18 100755 --- a/debian/rules +++ b/debian/rules @@ -1080,7 +1080,7 @@ override_dh_auto_install: # Only run on executable, not script chrpath -d `find $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable -exec file -i '{}' \; | grep 'x-executable; charset=binary'|cut -d: -f1` -ifeq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe)) +ifeq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe sparc sparc64)) ifneq (,$(filter $(DEB_HOST_ARCH_OS),linux)) # To fix custom-library-search-path chrpath -d $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)*/lib/linux/*.so From 1d6486afa7fa3a1748a734dcd6f7c3ad6f997009 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Fri, 10 Nov 2023 13:46:03 +0100 Subject: [PATCH 03/13] [ Matthias Klose ] * Build-depend on llvm-spirv-17. --- debian/changelog | 3 +++ debian/control | 2 +- debian/control.in | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 576bcd1b..242266f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ llvm-toolchain-17 (1:17.0.4-2) UNRELEASED; urgency=medium [ John Paul Adrian Glaubitz ] * Don't run chrpath for libclang on sparc and sparc64 + [ Matthias Klose ] + * Build-depend on llvm-spirv-17. + -- John Paul Adrian Glaubitz Thu, 09 Nov 2023 10:07:49 +0100 llvm-toolchain-17 (1:17.0.4-1) unstable; urgency=medium diff --git a/debian/control b/debian/control index ad287418..cd9824a2 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,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-17 [ amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x ] | hello [!i386], + llvm-spirv-17 [ amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], wasi-libc | hello [ !any-i386], libcurl4-openssl-dev | libcurl-dev, diff --git a/debian/control.in b/debian/control.in index 4f9e1e41..a80b6eb2 100644 --- a/debian/control.in +++ b/debian/control.in @@ -23,7 +23,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-17 [ amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x ] | hello [!i386], + llvm-spirv-17 [ amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], wasi-libc | hello [ !any-i386], libcurl4-openssl-dev | libcurl-dev, From 600418a0502e3ce48cc82758da2509548ac61722 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 09:49:30 +0100 Subject: [PATCH 04/13] remove unecessary quotes --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index ef61242b..83ffd9f1 100755 --- a/debian/rules +++ b/debian/rules @@ -271,8 +271,8 @@ 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)" + 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 From 8b7ecb4ecb3b3ef767eaa76cb46ad43a4a1ca842 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 09:57:06 +0100 Subject: [PATCH 05/13] add debug info --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 83ffd9f1..9983fc0c 100755 --- a/debian/rules +++ b/debian/rules @@ -542,6 +542,7 @@ preconfigure: @echo "COMPILER_RT_WASM_ENABLE=$(COMPILER_RT_WASM_ENABLE)" @echo "LIBCXX_WASM_ENABLE=$(LIBCXX_WASM_ENABLE)" @echo "SCCACHE_ENABLE=$(SCCACHE_ENABLE)" + @echo "LLVM_SPIRV_INSTALLED=$(LLVM_SPIRV_INSTALLED)" for f in debian/*.in; do \ f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ From f666a0bd0f7f3ee59e99db8696e86f432db60201 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 09:58:34 +0100 Subject: [PATCH 06/13] Do not build spirv features on bookworm as the spirv compiler is too old: FAILED: spirv-mesa3d-.spv /build/source/libclc/build/spirv-mesa3d-.spv cd /build/source/libclc/build && /usr/bin/llvm-spirv-15 --spirv-max-version=1.1 -o spirv-mesa3d-.spv builtins.link.spirv-mesa3d-.bc Unknown attribute kind (86) (Producer: 'LLVM16.0.6' Reader: 'LLVM 15.0.6') --- debian/changelog | 15 ++++++++++++++- debian/rules | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0d1f3df8..c49c4b98 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,26 @@ llvm-toolchain-16 (1:16.0.6-18) UNRELEASED; urgency=medium + [ Gianfranco Costamagna ] * Upload to sid + + [ Sylvestre Ledru ] + * Do not build spirv features on bookworm as the spirv compiler + is too old: + FAILED: spirv-mesa3d-.spv /build/source/libclc/build/spirv-mesa3d-.spv + cd /build/source/libclc/build && /usr/bin/llvm-spirv-15 + --spirv-max-version=1.1 -o spirv-mesa3d-.spv builtins.link.spirv-mesa3d-.bc + Unknown attribute kind (86) (Producer: 'LLVM16.0.6' Reader: 'LLVM 15.0.6') + + [ Steve Langasek ] * Add noble as supported Ubuntu release [ John Paul Adrian Glaubitz ] * Don't run chrpath for libclang on sparc and sparc64 - -- Gianfranco Costamagna Wed, 25 Oct 2023 08:10:35 +0200 + [ Sylvestre Ledru ] + + -- Sylvestre Ledru Sat, 11 Nov 2023 09:57:35 +0100 llvm-toolchain-16 (1:16.0.6-17exp1) experimental; urgency=medium diff --git a/debian/rules b/debian/rules index 9983fc0c..c58bbda6 100755 --- a/debian/rules +++ b/debian/rules @@ -260,7 +260,7 @@ endif 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) + ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv-$(LLVM_SPIRV_VERSION)) gt 15.0.0 ; echo $$?),0) # Too old llvm-spirv version are failing. See #52200 LLVM_SPIRV_INSTALLED = yes else From d7a2adfa6227a4f6f08d326d694f39f0730f7951 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 09:58:56 +0100 Subject: [PATCH 07/13] prepare upload --- debian/changelog | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c49c4b98..2f420db3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-16 (1:16.0.6-18) UNRELEASED; urgency=medium +llvm-toolchain-16 (1:16.0.6-18) unstable; urgency=medium [ Gianfranco Costamagna ] * Upload to sid @@ -11,7 +11,6 @@ llvm-toolchain-16 (1:16.0.6-18) UNRELEASED; urgency=medium --spirv-max-version=1.1 -o spirv-mesa3d-.spv builtins.link.spirv-mesa3d-.bc Unknown attribute kind (86) (Producer: 'LLVM16.0.6' Reader: 'LLVM 15.0.6') - [ Steve Langasek ] * Add noble as supported Ubuntu release From 3975016630840eb5c4933e404882de86f3c3e53b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 10:53:12 +0100 Subject: [PATCH 08/13] For Ubuntu bionic, improve the deactivation of lldb python --- debian/changelog | 1 + debian/rules | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2f420db3..93e8c44e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ llvm-toolchain-16 (1:16.0.6-18) unstable; urgency=medium cd /build/source/libclc/build && /usr/bin/llvm-spirv-15 --spirv-max-version=1.1 -o spirv-mesa3d-.spv builtins.link.spirv-mesa3d-.bc Unknown attribute kind (86) (Producer: 'LLVM16.0.6' Reader: 'LLVM 15.0.6') + * For Ubuntu bionic, improve the deactivation of lldb python [ Steve Langasek ] * Add noble as supported Ubuntu release diff --git a/debian/rules b/debian/rules index c58bbda6..20eb11af 100755 --- a/debian/rules +++ b/debian/rules @@ -399,9 +399,13 @@ else PROJECTS+=;lldb endif -ifneq (,$(filter $(DISTRO),buster)) +LLDB_PYTHON_DISABLE_DISTRO := bionic buster +LLDB_PYTHON_ENABLE=yes +# Disable zstd on old distro, fails on lld +ifeq (,$(filter-out $(LLDB_PYTHON_DISABLE_DISTRO), $(DISTRO))) # Don't enable lld python for old distros STAGE_ALL_CMAKE_EXTRA += -DLLDB_ENABLE_PYTHON=OFF + LLDB_PYTHON_ENABLE=no endif LIBCXX_WASM_ENABLE=yes @@ -1201,6 +1205,8 @@ endif if test "$(DISTRO)" = "buster" -o "$(DISTRO)" = "bionic" -o "$(DEB_HOST_ARCH)" = "mips64el"; then \ mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/share/gdb/python/ompd/; \ touch $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/share/gdb/python/ompd/empty; \ + fi + if test "$(LLDB_PYTHON_ENABLE)" = no; then \ echo "" > debian/python3-lldb-$(LLVM_VERSION).install; \ fi From 80a169f8c2377ac39817cfd9aba8bda17a2ac2e6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 11:03:48 +0100 Subject: [PATCH 09/13] fix the space syntax --- debian/rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 20eb11af..d4b9b8e2 100755 --- a/debian/rules +++ b/debian/rules @@ -257,6 +257,7 @@ 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 else @@ -268,7 +269,7 @@ else endif endif -LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" +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- From 056802f7cd51308532d8f216f9bee6e4cf156138 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 19:27:27 +0100 Subject: [PATCH 10/13] Change the logic to disable SPIRV. Disable it on most of the versions because it needs llvm-spirv-16. Enabled on trixie/sid, Ubuntu Mantic --- debian/changelog | 5 +++-- debian/rules | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 93e8c44e..e4a7373e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ llvm-toolchain-16 (1:16.0.6-18) unstable; urgency=medium * Upload to sid [ Sylvestre Ledru ] - * Do not build spirv features on bookworm as the spirv compiler - is too old: + * Change the logic to disable SPIRV. Disable it on most of the versions because + it needs llvm-spirv-16. + Enabled on trixie/sid, Ubuntu Mantic FAILED: spirv-mesa3d-.spv /build/source/libclc/build/spirv-mesa3d-.spv cd /build/source/libclc/build && /usr/bin/llvm-spirv-15 --spirv-max-version=1.1 -o spirv-mesa3d-.spv builtins.link.spirv-mesa3d-.bc diff --git a/debian/rules b/debian/rules index d4b9b8e2..8d8d034a 100755 --- a/debian/rules +++ b/debian/rules @@ -258,14 +258,18 @@ ifndef LLVM_SPIRV LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv-$(LLVM_SPIRV_VERSION)" 2>/dev/null) endif +# Disable spirv support for most of the distro versions +# It needs llvm-spirv-16 and it is rarely available +# Be prescritive +SPIRV_DISABLE_DISTRO := bionic buster lunar jammy focal buster bullseye bookworm 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 15.0.0 ; echo $$?),0) + ifeq (,$(filter-out $(SPIRV_DISABLE_DISTRO), $(DISTRO))) # Too old llvm-spirv version are failing. See #52200 - LLVM_SPIRV_INSTALLED = yes - else LLVM_SPIRV_INSTALLED = no + else + LLVM_SPIRV_INSTALLED = yes endif endif @@ -547,6 +551,7 @@ preconfigure: @echo "COMPILER_RT_WASM_ENABLE=$(COMPILER_RT_WASM_ENABLE)" @echo "LIBCXX_WASM_ENABLE=$(LIBCXX_WASM_ENABLE)" @echo "SCCACHE_ENABLE=$(SCCACHE_ENABLE)" + @echo "LLVM_SPIRV=$(LLVM_SPIRV)" @echo "LLVM_SPIRV_INSTALLED=$(LLVM_SPIRV_INSTALLED)" for f in debian/*.in; do \ From 43c7b3b296b647932806dc4f82dfce698c423a97 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 11 Nov 2023 20:09:55 +0100 Subject: [PATCH 11/13] disable spv files too --- debian/rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/rules b/debian/rules index 8d8d034a..53d6bfca 100755 --- a/debian/rules +++ b/debian/rules @@ -577,12 +577,12 @@ preconfigure: debian/llvm-$(LLVM_VERSION)-linker-tools.links \ debian/libbolt-$(LLVM_VERSION)-dev.install -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 "$(LLVM_SPIRV_INSTALLED)" = "no"; then \ + sed -i -e "s|#spv\ ||g" debian/libclc-$(LLVM_VERSION).install; \ + fi # disable libc++-X.Y-dev-wasm32.install.in on old distro if test "$(LIBCXX_WASM_ENABLE)" = "no"; then \ From ff67b0586979bccf862bd2d5ea6cc4175c281c31 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 12 Nov 2023 09:43:04 +0100 Subject: [PATCH 12/13] fix the check --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 53d6bfca..3827c0f5 100755 --- a/debian/rules +++ b/debian/rules @@ -580,7 +580,7 @@ preconfigure: # 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. - if test "$(LLVM_SPIRV_INSTALLED)" = "no"; then \ + if test "$(LLVM_SPIRV_INSTALLED)" = "yes"; then \ sed -i -e "s|#spv\ ||g" debian/libclc-$(LLVM_VERSION).install; \ fi From fe997716a1735cfac649a25c252bad302cec762f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 12 Nov 2023 12:24:32 +0100 Subject: [PATCH 13/13] fix the declaration for the archs --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 3827c0f5..79ac1d6f 100755 --- a/debian/rules +++ b/debian/rules @@ -798,7 +798,7 @@ debian-libclc-build: -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CMAKE_DIR=$(STAGE_2_BIN_DIR)/../ \ $(LIBCLC_LLVM_SPIRV) \ - -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ + -DLIBCLC_TARGETS_TO_BUILD="$(LIBCLC_TARGETS_TO_BUILD)"; \ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(STAGE_2_LIB_DIR) ninja -j $(NJOBS) $(VERBOSE) ifndef LLVM_SPIRV echo "libclc built without SPIRV (.spv) outputs because llvm-spirv wasn't found"