From 799d338af9bc4f239b2a01a1115f6c522f4d0495 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 31 Aug 2017 17:15:31 +0000 Subject: [PATCH] * Fix the FTBFS because of -gsplit-dwarf: - Only enable it on archs which needs it - Only enable it when gcc supports it correctly --- debian/changelog | 8 ++++++++ debian/rules | 14 ++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 41197542..3cef2ee3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-4.0 (1:4.0.1-3) UNRELEASED; urgency=medium + + * Fix the FTBFS because of -gsplit-dwarf: + - Only enable it on archs which needs it + - Only enable it when gcc supports it correctly + + -- Sylvestre Ledru Thu, 31 Aug 2017 19:14:39 +0200 + llvm-toolchain-4.0 (1:4.0.1-2) unstable; urgency=medium * Rebuild with gcc 7 to fix a relocation error (Closes: #866354) diff --git a/debian/rules b/debian/rules index 5d31deb1..6d9cdca0 100755 --- a/debian/rules +++ b/debian/rules @@ -35,15 +35,21 @@ 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))) 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 ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 7.1.0-7~ ; echo $$?),0) -# Do not pass -gsplit-dwarf with gcc 7. This is causing some linking issues -# More: https://bugs.llvm.org/show_bug.cgi?id=34140 +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) ge 7.2.0-2 ; echo $$?),0) +# 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 -endif -endif +endif # > 7.2.0-2 +endif # < gcc 7 +endif # binutils +endif # archs ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 4.7.2-10~ ; echo $$?),0)