* Fix the FTBFS because of -gsplit-dwarf:

- Only enable it on archs which needs it
  - Only enable it when gcc supports it correctly
This commit is contained in:
Sylvestre Ledru 2017-08-31 17:15:36 +00:00
parent 90cccec90f
commit fe2bc5ec03
2 changed files with 18 additions and 4 deletions

8
debian/changelog vendored
View File

@ -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 <sylvestre@debian.org> Thu, 31 Aug 2017 19:14:45 +0200
llvm-toolchain-5.0 (1:5.0~+rc4-1) unstable; urgency=medium
* New testing release

14
debian/rules vendored
View File

@ -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)