Link with --no-keep-files-mapped --no-map-whole-files when using gold.

This commit is contained in:
Sylvestre Ledru 2017-09-08 10:01:11 +00:00
parent c2179a304d
commit 7e366d9354
2 changed files with 9 additions and 2 deletions

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
llvm-toolchain-4.0 (1:5.0-1~exp2) UNRELEASED; urgency=medium
[ Matthias Klose ]
* Link with --no-keep-files-mapped --no-map-whole-files when using gold.
-- Sylvestre Ledru <sylvestre@debian.org> Fri, 08 Sep 2017 11:59:03 +0200
llvm-toolchain-4.0 (1:4.0.1-4) unstable; urgency=medium
* Fail the build if the arch + gcc has a broken gsplit-dwarf support

4
debian/rules vendored
View File

@ -86,8 +86,8 @@ BINUTILS_GOLD_ARCHS := amd64 armhf i386 powerpcspe ppc64 ppc64el sparc sparc64 x
ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.23.1-1~exp3 ; echo $$?),0)
ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_GOLD_ARCHS)))
# -fused-ld=gold enables the gold linker (but is not supported by all archs / distro)
LDFLAGS_EXTRA += -fuse-ld=gold
CXXFLAGS_EXTRA += -Wl,-fuse-ld=gold
LDFLAGS_EXTRA += -fuse-ld=gold --no-keep-files-mapped --no-map-whole-files
CXXFLAGS_EXTRA += -Wl,-fuse-ld=gold -Wl,--no-keep-files-mapped -Wl,--no-map-whole-files
CMAKE_EXTRA += -DLLVM_BINUTILS_INCDIR=/usr/include/
endif
endif