Use the gold linker for linux/ARM and android/ARM targets.
Fixes #8976 and #9873 by making use of the Binutils ld.gold linker explicit whenever the target is linux/ARM or android/ARM. This does not affect iOS where Apple provides its own linker. In order to achieve this, we need to add `-fuse-ld=gold` to the SettingsCCompilerLinkFlags setting and set SettingsLdCommand to `ld.gold` (or `${target}-ld.gold` when cross-compiling). In addition, simplifying the use of `$(CONF_GCC_LINKER_OPTS_STAGEn)`. This patch was tested by ensuring that the following worked as expected: * Native builds on linux/x86_64 (nothing changed). * Native builds on linux/arm (and uses the gold linker). * Linux to linux/arm cross compiles (and uses the cross gold linker). Contributions by Ben Gamari, Joachim Breitner and Reid Barton. Reviewers: nomeata, bgamari, austin, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D715 GHC Trac Issues: #8976 #9873 (cherry picked from commit 71fcc4c0)
Showing
- aclocal.m4 5 additions, 0 deletionsaclocal.m4
- configure.ac 12 additions, 1 deletionconfigure.ac
- libffi/ghc.mk 1 addition, 1 deletionlibffi/ghc.mk
- mk/config.mk.in 0 additions, 1 deletionmk/config.mk.in
- rules/build-package-data.mk 1 addition, 1 deletionrules/build-package-data.mk
- rules/distdir-opts.mk 0 additions, 1 deletionrules/distdir-opts.mk
Please register or sign in to comment