diff --git a/debian/changelog b/debian/changelog index 7facbc21..8aa9764f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ llvm-toolchain-12 (1:12.0.1-4) UNRELEASED; urgency=medium + [ Sylvestre Ledru ] * Make libunwind-dev depends on libunwind * Don't build libunwind on hurd, armel, powerpc & mipsel + [ Jordan Justen ] + * libclc: Include libclc spir-v outputs (used by Mesa opencl) + -- Sylvestre Ledru Sun, 08 Aug 2021 10:58:54 +0200 llvm-toolchain-12 (1:12.0.1-3) unstable; urgency=medium diff --git a/debian/control b/debian/control index 9ce586c5..52dc92ac 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,8 @@ Build-Depends: debhelper (>= 9.0), cmake, chrpath, texinfo, sharutils, ocaml-findlib [amd64 arm64 armhf ppc64el s390x], libctypes-ocaml-dev [amd64 arm64 armhf ppc64el s390x], dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el s390x], - libpfm4-dev [linux-any], python3-setuptools, libz3-dev + libpfm4-dev [linux-any], python3-setuptools, libz3-dev, + llvm-spirv, spirv-tools Build-Conflicts: oprofile, ocaml Standards-Version: 4.2.1 Homepage: https://www.llvm.org/ diff --git a/debian/libclc-X.Y.install.in b/debian/libclc-X.Y.install.in index 36023694..679ba86f 100644 --- a/debian/libclc-X.Y.install.in +++ b/debian/libclc-X.Y.install.in @@ -1 +1,2 @@ usr/lib/clc/*.bc +usr/lib/clc/*.spv diff --git a/debian/patches/libclc-llvm-spirv.diff b/debian/patches/libclc-llvm-spirv.diff new file mode 100644 index 00000000..d6a57203 --- /dev/null +++ b/debian/patches/libclc-llvm-spirv.diff @@ -0,0 +1,13 @@ +diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt +index b8b5ceff086c..5964468358f2 100644 +--- a/libclc/CMakeLists.txt ++++ b/libclc/CMakeLists.txt +@@ -95,7 +95,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 11663d97..aa6a7590 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -144,3 +144,5 @@ lld-use-link-atomic-i386.diff D99501-ignore-lto-auto.diff scan-build-py-fix-analyze-path.diff scan-build-py-fix-default-bin.diff + +libclc-llvm-spirv.diff diff --git a/debian/rules b/debian/rules index 3cf10352..5d083797 100755 --- a/debian/rules +++ b/debian/rules @@ -31,6 +31,7 @@ endif VENDOR=$(shell lsb_release -is) DISTRO=$(shell lsb_release -sc) +DISTRO_RELEASE=$(shell lsb_release -sr) DH_VERSION := $(shell dpkg -s debhelper | grep '^Version' | awk '{print $$2}') @@ -132,6 +133,25 @@ else control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif +ENABLE_SPRIV = yes +# Disable spirv on Debian older than bullseye (11) +ifeq ($(shell dpkg-vendor --is Debian && echo yes),yes) +ifeq ($(shell dpkg --compare-versions $(DISTRO_RELEASE) lt 11 ; echo $$?),0) + ENABLE_SPRIV = no +endif +endif +# Disable spirv on Ubuntu older than focal (20.04) +ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) +ifeq ($(shell dpkg --compare-versions $(DISTRO_RELEASE) lt 20 ; echo $$?),0) + ENABLE_SPRIV = no +endif +endif + +LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" +ifeq ($(ENABLE_SPRIV),yes) + LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD)";spirv-mesa3d-;spirv64-mesa3d-" +endif + # Disabled: # Host compiler does not support '-fuse-ld=lld' # USE_LLD_ARCHS := amd64 @@ -541,7 +561,7 @@ debian-libclc-build: -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CONFIG=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/llvm-config \ - -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"; \ + -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ make $(NJOBS) $(VERBOSE) touch $@