]> git.proxmox.com Git - llvm-toolchain.git/commitdiff
Disable compiler-rt on 32bit architectures except i386
authorGianfranco Costamagna <costamagnagianfranco@yahoo.it>
Sun, 3 Mar 2024 10:54:05 +0000 (11:54 +0100)
committerGianfranco Costamagna <costamagnagianfranco@yahoo.it>
Sun, 3 Mar 2024 11:05:08 +0000 (12:05 +0100)
debian/rules

index e6f6f3111811a6a0fc135bdcb78455339bc5d025..08635e55a2cd82761ef2338c7733dc073a055670 100755 (executable)
@@ -3,7 +3,6 @@
 # polly & lldb aren't enabled for every platform
 PROJECTS = clang;clang-tools-extra;lld;cross-project-tests;mlir
 # openmp & libunwind aren't enabled for every platform
-RUNTIMES = compiler-rt;libcxx;libcxxabi
 
 TARGET_BUILD   := build-llvm
 TARGET_BUILD_STAGE2    := $(TARGET_BUILD)/tools/clang/stage2-bins
@@ -20,6 +19,20 @@ ifeq ($(LLVM_VERSION),$(LLVM_VERSION_FULL))
        LLVM_VERSION_FULL := $(LLVM_VERSION).0.0
 endif
 
+# dpkg-buildflags support
+# disable fixfilepath in favor of the llvm-project supplied flavor, disable lto
+export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto
+ifeq ($(DEB_HOST_ARCH),i386)
+  RUNTIMES = compiler-rt;libcxx;libcxxabi
+else
+  ifeq ($(DEB_HOST_ARCH_BITS),32)
+    RUNTIMES = libcxx;libcxxabi
+    skip_packages = -Nlibclang-rt-$(LLVM_VERSION)-dev
+  else
+    RUNTIMES = compiler-rt;libcxx;libcxxabi
+  endif
+endif
+
 SOURCE_NAME := $(shell dpkg-parsechangelog -S Source)
 ifneq (,$(findstring snapshot,$(SOURCE_NAME)))
   BRANCH_NAME=snapshot
@@ -46,9 +59,6 @@ include /usr/share/dpkg/architecture.mk
 
 CONFIGURE_EXTRA =
 
-# dpkg-buildflags support
-# disable fixfilepath in favor of the llvm-project supplied flavor, disable lto
-export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto
 # these are handled on a per stage / build basis
 export DEB_CFLAGS_MAINT_STRIP = -g -O2
 export DEB_CXXFLAGS_MAINT_STRIP = -g -O2
@@ -1038,7 +1048,7 @@ override_dh_auto_install:
 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
+       chrpath -d $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)*/lib/linux/*.so || true
 endif
 endif
 
@@ -1289,7 +1299,7 @@ else
        rm -rf $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake
 endif
 endif
-       dh_install --fail-missing
+       dh_install --fail-missing ${skip_packages}
 # Move the libc++ abi files from libc++ to libc++-abi for the wasm32 packages
 # These packages are arch: all, so only do so when the packages are built
 ifneq (,$(filter libc++-$(LLVM_VERSION)-dev-wasm32, $(shell dh_listpackages)))
@@ -1417,8 +1427,11 @@ override_dh_auto_test:
 endif
 
 
+override_dh_builddeb:
+       dh_builddeb ${skip_packages}
+
 override_dh_gencontrol: sccache-stats
-       dh_gencontrol -- $(control_vars)
+       dh_gencontrol ${skip_packages} -- $(control_vars)
 
 
 override_dh_auto_clean: