diff --git a/debian/changelog b/debian/changelog index e707ced2..c7e87eed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-snapshot (1:6.0~svn311834-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:53 +0200 + llvm-toolchain-snapshot (1:6.0~svn311834-1) unstable; urgency=medium * Link LLDB with -latomic on powerpcspe (Closes: #872267) diff --git a/debian/rules b/debian/rules index 0af8b246..665f217d 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.9-20140411-1~ ; echo $$?),0)