From 1f3c14f3bc5973bc48a473785c3b18347e5a820c Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Tue, 16 Oct 2018 10:58:52 +0200 Subject: [PATCH] Cherry-pick mips and mipsel build fix from 7 branch --- debian/changelog | 5 +++++ debian/rules | 21 +++++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index de359165..f39551da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ llvm-toolchain-snapshot (1:8~svn342269-2) UNRELEASED; urgency=medium + [ Sylvestre Ledru ] * Remove bat files https://bugs.llvm.org/show_bug.cgi?id=30755 * Fix the autopkgtest script (no gcc in the test) * remove dep from lld to llvm-8-dev because lld @@ -12,6 +13,10 @@ llvm-toolchain-snapshot (1:8~svn342269-2) UNRELEASED; urgency=medium * Install bash-completion for clang * Disable ocaml on armel + [ Gianfranco Costamagna ] + * Take option two in bug #877567 to fix FTBFS on mips and mipsel + + -- Sylvestre Ledru Fri, 21 Sep 2018 22:48:47 +0200 llvm-toolchain-7 (1:7-5) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 61348387..332d30dd 100755 --- a/debian/rules +++ b/debian/rules @@ -49,22 +49,6 @@ endif # Cxx flags for building libcxx and libcxxabi LIBCXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) -# 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 -ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 7.1.0-7~ || \ - 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 -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 -endif # archs - ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 4.9-20140411-1~ ; echo $$?),0) # Too old version of gcc. Force 4.9 GCC_VERSION := 4.9 @@ -75,6 +59,11 @@ export CXX=g++-$(GCC_VERSION) opt_flags = -O2 -DNDEBUG +# Only enable g1 on archs which needs it (it fixes an OOM during dh_strip due to huge symbols) +ifeq ($(DEB_HOST_ARCH_BITS),32) +opt_flags += -g1 +endif + ifneq (,$(findstring $(DEB_HOST_ARCH),armel)) opt_flags += -marm # 3.8 fails to build, disable the compiler_rt builtins