[GHC] #13541: Make it easier to use the gold linker
GHC
ghc-devs at haskell.org
Mon Jul 3 23:42:46 UTC 2017
#13541: Make it easier to use the gold linker
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature request | Status: patch
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #13810, #13739 | Differential Rev(s): Phab:D3449,
Wiki Page: | Phab:D3694
-------------------------------------+-------------------------------------
Comment (by Ben Gamari <ben@…>):
In [changeset:"960918bd1f7e3811845a525ba85bbd390ddf28c8/ghc"
960918bd/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="960918bd1f7e3811845a525ba85bbd390ddf28c8"
Add -fuse-ld flag to CFLAGS during configure
The decisions made by configure later in the script may depend upon the
linker used. Consequently, it is important that configure uses the same
linker as GHC will eventually use.
For instance, on Nix I found that a program requiring `libpthread` would
link fine with only `-lrt` when linked with BFD ld. However, with gold
we needed to explicitly provide the `-lpthread` dependency. Presumably
the former would happily loaded any `NEEDED` libraries whereas the
latter wants them explicitly given. Regardless, since `configure`'s
`NEED_PTHREAD_LIB` check didn't use the `-fuse-ld` flag that GHC would
eventually use, we inferred the wrong value, resulting in link errors
later in the build.
Test Plan: Validate
Reviewers: austin, hvr
Subscribers: rwbarton, thomie, erikd
GHC Trac Issues: #13541
Differential Revision: https://phabricator.haskell.org/D3694
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13541#comment:31>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list