summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:37 +0000
commit2d0ec380bae2ec8d51b6193fee6577188c6bb2ec (patch)
tree00f9136b2844d7e9ddc861b845ccc309aaa6091a /debian/rules
parentMerging upstream version 1.70.0+dfsg1. (diff)
downloadrustc-2d0ec380bae2ec8d51b6193fee6577188c6bb2ec.tar.xz
rustc-2d0ec380bae2ec8d51b6193fee6577188c6bb2ec.zip
Adding debian version 1.70.0+dfsg1-7.debian/1.70.0+dfsg1-7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules25
1 files changed, 23 insertions, 2 deletions
diff --git a/debian/rules b/debian/rules
index 460e55720..8384119b3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,8 +34,8 @@ export RUST_LONG_VERSION
DEB_DESTDIR := $(CURDIR)/debian/tmp
# Use system LLVM (comment out to use vendored LLVM)
-LLVM_VERSION = 15
-OLD_LLVM_VERSION = 14
+LLVM_VERSION = 16
+OLD_LLVM_VERSION = 15
# Make it easier to test against a custom LLVM
ifneq (,$(LLVM_DESTDIR))
LLVM_LIBRARY_PATH := $(LLVM_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH):$(LLVM_DESTDIR)/usr/lib
@@ -43,6 +43,25 @@ LD_LIBRARY_PATH := $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):$(LLVM_LIBRARY_PAT
export LD_LIBRARY_PATH
endif
+# Required for profiler builtin
+CLANG_RT_ARCH := $(DEB_TARGET_GNU_CPU)
+ifeq (i386,$(DEB_TARGET_ARCH))
+CLANG_RT_ARCH = i386
+endif
+ifeq (armhf,$(DEB_TARGET_ARCH))
+CLANG_RT_ARCH = armhf
+endif
+
+ifneq (,$(filter $(DEB_TARGET_ARCH), sparc64 mips64el)))
+# sparc64: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061125
+# mips64el: has profiler, but buggy atm (32-bit overflow in some counter?)
+CLANG_RT_ARCH =
+PROFILER = "false"
+else
+export LLVM_PROFILER_RT_LIB=/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)/lib/linux/libclang_rt.profile-$(CLANG_RT_ARCH).a
+PROFILER = "true"
+endif
+
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NJOBS := -j $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
@@ -209,6 +228,7 @@ debian/config.toml: debian/config.toml.in debian/rules
-DLLVM_DESTDIR="$(LLVM_DESTDIR)" \
-DLLVM_VERSION="$(LLVM_VERSION)" \
-DRUST_DESTDIR="$(RUST_DESTDIR)" \
+ -DPROFILER="$(PROFILER)" \
"$<" > "$@"
if $(DOWNLOAD_BOOTSTRAP) || [ $(HAVE_BINARY_TARBALL) != 0 ]; \
then sed -i -e '/^rustc = /d' -e '/^cargo = /d' "$@"; fi
@@ -481,6 +501,7 @@ source_orig-stage0:
QUILT_PATCHES=debian/patches quilt push -aq; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE)
$(MAKE) -f debian/rules clean
debian/make_orig-stage0_tarball.sh
+ $(MAKE) -f debian/rules clean
QUILT_PATCHES=debian/patches quilt pop -aq; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE)
rm -rf .pc