From c039e0465f0fc6636bc09a2874823ee0be6c54bb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 1 Aug 2021 11:42:52 +0200 Subject: [PATCH] Build libunwind only on amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 sparc sparc64 Not supported on s390x for example --- debian/changelog | 8 ++++++++ debian/control | 4 ++-- debian/rules | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc8e5a8f..aa3ab28f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-12 (1:12.0.1-3) unstable; urgency=medium + + * Build libunwind only on amd64 arm64 armhf i386 + mips64el ppc64el ppc64 riscv64 sparc sparc64 + Not supported on s390x for example + + -- Sylvestre Ledru Sun, 01 Aug 2021 11:42:20 +0200 + llvm-toolchain-12 (1:12.0.1-2) unstable; urgency=medium * Generate libunwind-12 & libunwind-12-dev packages diff --git a/debian/control b/debian/control index 7f887bfe..15fd434d 100644 --- a/debian/control +++ b/debian/control @@ -718,7 +718,7 @@ Description: OpenCL C language implementation - development files Package: libunwind-12 Section: libs -Architecture: any +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 sparc sparc64 Multi-Arch: same Depends: ${shlibs:Depends}, ${misc:Depends} @@ -735,7 +735,7 @@ Description: production-quality unwinder Package: libunwind-12-dev Section: libdevel -Architecture: any +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 sparc sparc64 Multi-Arch: same Depends: ${misc:Depends}, diff --git a/debian/rules b/debian/rules index d3c73159..5771645b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f # polly, openmp & lldb aren't enabled for every platform -PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;debuginfo-tests;libunwind +PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;debuginfo-tests TARGET_BUILD := build-llvm TARGET_BUILD_STAGE2 := $(TARGET_BUILD)/tools/clang/stage2-bins @@ -187,6 +187,14 @@ else # CMAKE_EXTRA += -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=ON -DLLVM_ENABLE_RUNTIMES=openmp endif +# Enable libunwind (or not) +LIBUNWIND_ENABLE=yes +ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 sparc sparc64)) + LIBUNWIND_ENABLE=no +else + PROJECTS+=;libunwind +endif + RUN_TEST=yes ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) RUN_TEST=no @@ -623,8 +631,10 @@ override_dh_auto_install: cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && rm -f libomp.so; \ ln -s libomp.so.$(SONAME_OPENMP) libomp.so - mkdir -p debian/tmp/usr/include/libunwind - cp -R libunwind/include/* debian/tmp/usr/include/libunwind/ + if test "$(LIBUNWIND_ENABLE)" = yes; then \ + mkdir -p debian/tmp/usr/include/libunwind; \ + cp -R libunwind/include/* debian/tmp/usr/include/libunwind/; \ + fi if test "$(OPENMP_ENABLE)" = yes; then \ mkdir -p debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \