From 5e4558a84172a81ec893860060e5ab42396da248 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 19 Oct 2017 07:06:58 +0000 Subject: [PATCH] * Try to fix the mipsel FTBFS (Closes: #877567) I am trying the first option from the bug: - gsplit-dward on 32 bits archs - -g everywhere Many thanks to Adrian Bunk for that --- debian/changelog | 13 ++++++++++--- debian/patches/rL305193-backport.diff | 24 ++++++++++++------------ debian/rules | 12 +++--------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0589323f..57189402 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,17 @@ -llvm-toolchain-4.0 (1:4.0.1-7.1) UNRELEASED; urgency=medium +llvm-toolchain-4.0 (1:4.0.1-8) unstable; urgency=medium - * Non-maintainer upload. + [ Ximin Luo ] * Backport some patches (originally from rust, and upstreamed) to fix two failing tests in rustc. - -- Ximin Luo Wed, 18 Oct 2017 15:28:20 +0200 + [ Sylvestre Ledru ] + * Try to fix the mipsel FTBFS (Closes: #877567) + I am trying the first option from the bug: + - gsplit-dward on 32 bits archs + - -g everywhere + Many thanks to Adrian Bunk for that + + -- Sylvestre Ledru Wed, 18 Oct 2017 16:37:25 +0200 llvm-toolchain-4.0 (1:4.0.1-7) unstable; urgency=medium diff --git a/debian/patches/rL305193-backport.diff b/debian/patches/rL305193-backport.diff index 0f6d9ff0..563bc65e 100644 --- a/debian/patches/rL305193-backport.diff +++ b/debian/patches/rL305193-backport.diff @@ -378,15 +378,15 @@ Date: Mon Jun 12 14:56:02 2017 +0000 + %bar = alloca [32 x i64] + %foo_i8 = bitcast [32 x i64]* %foo to i8* + %bar_i8 = bitcast [32 x i64]* %bar to i8* -+ call void @llvm.lifetime.start.p0i8(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.start(i64 256, i8* %bar_i8) + call void @baz([32 x i64]* %bar, i32 1) -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %bar_i8) -+ call void @llvm.lifetime.start.p0i8(i64 256, i8* %foo_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.start(i64 256, i8* %foo_i8) + call void @baz([32 x i64]* %foo, i32 1) -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %foo_i8) -+ call void @llvm.lifetime.start.p0i8(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %foo_i8) ++ call void @llvm.lifetime.start(i64 256, i8* %bar_i8) + call void @baz([32 x i64]* %bar, i32 1) -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %bar_i8) + ret i1 true +} + @@ -403,24 +403,24 @@ Date: Mon Jun 12 14:56:02 2017 +0000 + %bar_i8 = bitcast [32 x i64]* %bar to i8* + br i1 %0, label %if_false, label %if_true +if_false: -+ call void @llvm.lifetime.start.p0i8(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.start(i64 256, i8* %bar_i8) + call void @baz([32 x i64]* %bar, i32 0) + br i1 %1, label %if_false.1, label %onerr +if_false.1: -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %bar_i8) + br label %merge +if_true: -+ call void @llvm.lifetime.start.p0i8(i64 256, i8* %foo_i8) ++ call void @llvm.lifetime.start(i64 256, i8* %foo_i8) + call void @baz([32 x i64]* %foo, i32 1) + br i1 %1, label %if_true.1, label %onerr +if_true.1: -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %foo_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %foo_i8) + br label %merge +merge: + ret i1 false +onerr: -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %foo_i8) -+ call void @llvm.lifetime.end.p0i8(i64 256, i8* %bar_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %foo_i8) ++ call void @llvm.lifetime.end(i64 256, i8* %bar_i8) + call void @destructor() + ret i1 true +} diff --git a/debian/rules b/debian/rules index 11a0987d..c666ccfe 100755 --- a/debian/rules +++ b/debian/rules @@ -35,9 +35,8 @@ ifneq (,$(filter $(DEB_HOST_ARCH),powerpc powerpcspe)) LDFLAGS_EXTRA += -latomic endif -ENABLE_SPLIT_DWARF_ARCHS := armel armhf i386 mips powerpc -# Only enable gsplit dwarf on archs which needs it -ifneq (,$(filter $(DEB_HOST_ARCH),$(ENABLE_SPLIT_DWARF_ARCHS))) +# Only enable gsplit dwarf on archs which needs it (32 bits) +ifeq ($(DEB_HOST_ARCH_BITS),32) ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.22.52.0.4 ; echo $$?),0) # when using -gsplit-dwarf, it will requires extract-dwo which doesn't exist on precise: # More: https://llvm.org/bugs/show_bug.cgi?id=28841 @@ -46,7 +45,7 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++ # Only pass -gsplit-dwarf with working version of gcc 7 # More: https://bugs.llvm.org/show_bug.cgi?id=34140 & https://bugs.debian.org/873609 CXXFLAGS_EXTRA += -gsplit-dwarf -else +else $(error "Broken gcc version for -gsplit-dwarf support. Please use < gcc 7 or >= 7.2.0-2") endif # < gcc 7 or >= 7.2.0-2 endif # binutils @@ -62,11 +61,6 @@ export CC=gcc-$(GCC_VERSION) export CXX=g++-$(GCC_VERSION) opt_flags = -O2 -DNDEBUG -ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 ppc64el s390x)) - opt_flags += -g1 -else - opt_flags += -g -endif ifneq (,$(findstring $(DEB_HOST_ARCH),armel)) opt_flags += -marm