diff --git a/debian/changelog b/debian/changelog index 71a10603..5d043c99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +llvm-toolchain-13 (1:13.0.1-8) UNRELEASED; urgency=medium + + [ 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 ] + * 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 + llvm-toolchain-13 (1:13.0.1-7) unstable; urgency=medium [ Michael Biebl ] 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 diff --git a/debian/rules b/debian/rules index e5d8cc21..891ce6b9 100755 --- a/debian/rules +++ b/debian/rules @@ -214,15 +214,30 @@ 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 llvm-spirv-$(LLVM_VERSION)" 2>/dev/null) + +ifndef LLVM_SPIRV + LLVM_SPIRV_INSTALLED = no else -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 renamed llvm-spirv-$(LLVM_VERSION) as of llvm-spirv-13 + LLVM_SPIRV_INSTALLED = yes + endif 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 @@ -635,7 +650,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 $@