diff --git a/debian/changelog b/debian/changelog index f2dd1eb4..84f25846 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-5.0 (1:5.0~+rc4-2) 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:45 +0200 + llvm-toolchain-5.0 (1:5.0~+rc4-1) unstable; urgency=medium * New testing release diff --git a/debian/rules b/debian/rules index 2fe46249..981067ef 100755 --- a/debian/rules +++ b/debian/rules @@ -34,15 +34,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)