[GHC] #13541: Make it easier to use the gold linker

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`. I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation. * -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`.
I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation.
*
New description: As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`. I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`.
I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation.
New description: As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`. I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation. In fact, I would even weakly suggest that we might consider enabling `--enable-gold` the default behavior, requiring the user to explicitly pass `--disable-gold` if they want the current behavior. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Another unfortunate aspect of the status quo is that the user may think that passing `LD=gold` to `./configure` will configure the compiler to use `gold`, but they would be wrong. Another approach that may be would be to check whether `LD` is set to `gold` and if so check for a functional `-fuse-ld=gold`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`.
I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optl`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation.
In fact, I would even weakly suggest that we might consider enabling `--enable-gold` the default behavior, requiring the user to explicitly pass `--disable-gold` if they want the current behavior.
New description: As pointed out in #4862, the `gold` linker is significantly faster than BFD `ld`. Currently we use whatever linker `gcc` uses by default. This is an unfortunate situation for users as few packagers take the effort to configure their builds to use `gold`. I think we should consider the following,
Introduce a configure flag (to both the source distribution, and the distributed binary distributions), `--enable-gold`. When enabled, `configure` will check for the functioning of `gcc -fuse-ld=gold`. If found to work `-fuse-ld=gold` would be added to GHC's `optlc`. The flag would throw an error on non-ELF platforms (which are not supported by `gold`).
While there is admittedly not a whole lot of precedent for this, the status quo means we are leaving a significant bit of compiler performance on the table in a majority of cases. Given that `stack` uses GHC's official bindists, we should try to improve this situation. In fact, I would even weakly suggest that we might consider enabling `--enable-gold` the default behavior, requiring the user to explicitly pass `--disable-gold` if they want the current behavior. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): A few things to note: - gold, does ELF only. So this should only be available and enabled if we are targeting elf. - I'd also suggest that this is only enabled by default if gcc is used. If clang is used or gcc /is/ clang, don't enable gold. I still believe that this kind of configuration should be part of the toolchain and not part of ghc though. I'm also a bit confused why gcc would not respect the LD env var. Maybe someone with better knowledge of the gcc toolchain knows. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thoughtpolice): Gold works perfectly fine with Clang on Linux. Why block that combination? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): I might have gone a bit overboard here. I'm not sure if this ticket is related to https://phabricator.haskell.org/D3351, however clang doesn't understand `-fuse-ld` (at least not the one that comes with the android toolchain, not sure if this statement holds universally), and thus forcing that flag results in a non-functioning compiler. I certainly don't want to block anything. I just don't want to have anything forced on me by default, which might run counter to my toolchain configuration. In my view this should be part of the toolchain, and ghc should ensure to pick up the configuration from the toolchain proper instead of doing the decision on its own. I guess a similar case could be made for using lld? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): To be clear, I don't think there is any need to block any particular combinations. We simply teach configure to check that `-fuse-ld=gold` works. If the compiler doesn't support it then the check fails and we either throw an error or proceed with the status quo. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): [[https://stackoverflow.com/questions/43243322/how-to-link-with-the-gnu- gold-linker-instead-of-ld-in-haskell/43243323#43243323|Apparently]] `lld` is another factor of three faster than `gold`, so I suppose if we want to go this route we should ensure the solution will extend to that case as well. I'd love to hear others opinions on this general direction. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): Replying to [comment:7 angerman]:
clang doesn't understand `-fuse-ld` (at least not the one that comes with the android toolchain, not sure if this statement holds universally)
This seems to be Android toolchain specific. Upstream clang suppports `-fuse-ld` since 2014: https://github.com/llvm- mirror/clang/commit/bab68c96f15867af6938d9c8f922d59d31351cad -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): Replying to [comment:5 angerman]:
I'm also a bit confused why gcc would not respect the LD env var.
I guess this may be controversial, but I have always liked the fact that cabal and GHC rely as little as possible on environment variables. It has made it much easier many times for me to debug ghc issues (funnily, especially the linker investigation) because I can see all relevant inputs to a ghc invocation simply in `ps` or `strace`, and re-run them to isolate problems without accidentally not replicating the environment correctly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nh2): * cc: nh2 (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): Replying to [comment:10 nh2]:
Replying to [comment:7 angerman]:
clang doesn't understand `-fuse-ld` (at least not the one that comes with the android toolchain, not sure if this statement holds universally)
This seems to be Android toolchain specific.
Upstream clang suppports `-fuse-ld` since 2014: https://github.com/llvm- mirror/clang/commit/bab68c96f15867af6938d9c8f922d59d31351cad
This likely has been a misreading of the error on my side, as noted in https://phabricator.haskell.org/D3351. The LD that comes witht he android toolchain is called <toolchain>-ld or <toolchain>-ld.gold, and both are effectively gold, and there is no tool called just `ld.gold`, there is one called `ld`, but that is ld64, and would be horribly wrong to use. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Replying to [comment:5 angerman]:
I'm also a bit confused why gcc would not respect the LD env var.
I guess this may be controversial, but I have always liked the fact that cabal and GHC rely as little as possible on environment variables.
It has made it much easier many times for me to debug ghc issues (funnily, especially the linker investigation) because I can see all relevant inputs to a ghc invocation simply in `ps` or `strace`, and re-run
#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): Replying to [comment:11 nh2]: them to isolate problems without accidentally not replicating the environment correctly. My personal issue with not respecting env variables is that, without respecting the environment, one has to - have explicit flags for each possible configuration value, that otherwise would have been taken from the environment. - by not using the environment, one is posed to break tooling that depends on the environment. GHC already has a lot of logic to find tools at configuration time and store their paths. `FIND_LD` already tries to detect gold, (and fails for the android toolchain...) I am much more in favor of doing tool checking rather than magic. What I mean is this: instead of trying hard to find some tool (say ld), use $LD. However if we know we want gold, try `$LD --version` to verify it actually *is* gold. And if it's not, put out a warning that $LD is not set to `gold` and that this is known not to work. However if you want to ignore the error pass `--compat-warning-only`. Which would then print a warning:
Warning: linker ($LD) does not seem to be gold. Continuing anyway due to --compat-warning-only.
instead of
Error: linker ($LD) does not seem to be gold. bfd is known not to work. To continue anyway, pass --compat-warning-only.
Then again, this makes me wonder why we test for gold, and not against bfd in the first place? Why force gold, if lld is fine as well, when all we want is to make sure we don't use a buggy/broken/slow linker called bfd? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by michalt): * cc: michalt (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by duog): * cc: duog (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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 | Differential Rev(s): Phab:D3449 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * differential: => Phab:D3449 * related: => #13810 Comment: #13810 demonstrates the terrible brittleness of the current state of affairs, where we rely on users to explicitly set their choice of linker. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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 | Differential Rev(s): Phab:D3449 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I've updated Phab:D3449 to reflect my current thinking on this. Namely, we provide a `configure` flag that indicates that the user doesn't mind if GHC overrides the system's default linker. If this flag is passed, we use either `gold` or `lld`, if available. The user can explicitly request one or the other by passing the `LD=...` variable to `configure`. Does this seem reasonable? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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 | Differential Rev(s): Phab:D3449 Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2):
The user can explicitly request one or the other by passing the LD=... variable to configure.
@bgamari: To clarify, will GHC still at run-time detect which linker is available, and can the user still at run-time tell GHC which linker to use? At configure time, gold may not be installed, or it may be uninstalled afterwards, or the user maybe be using a bindist but for some reasons wants to force GHC to use `ld` or `gold` (for example, if `gold` doesn't work for them for some reason). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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 | Differential Rev(s): Phab:D3449 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The diff doesn't touch the runtime linker-detection logic. It also doesn't provide a way for the user to override the linker choice, but this could be fixed. However, I do wish we could drop the runtime probing at some point. Currently we start `gcc -v` and `ld -v` on every single GHC compilation. On platforms like Windows this can really add up. Even on Linux, where process spawning is relatively fast, it's probably 5 to 10 milliseconds per execution. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * related: #13810 => #13810, #13739 Comment: Simon Marlow has said that he would really like to see this happen in 8.2.1 due to the regressions in #13739. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => highest * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: feature request | Status: new 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: (none) => bgamari -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: bgamari
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: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: feature request | Status: merge 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:27 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: feature request | Status: closed Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.2` as 2785ef0e31a123400da950ffafebe6cb1ce3f4eb. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:28 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: new 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 -------------------------------------+------------------------------------- Changes (by bgamari): * owner: bgamari => (none) * status: closed => new * differential: Phab:D3449 => Phab:D3449, Phab:D3694 * resolution: fixed => Comment: I found a bug in the above. See Phab:D3694 for the fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:30 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: closed Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | 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 -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Merged to `ghc-8.2` with 0798908f1729629c2d90a56baae06919874b42a4. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:32 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature request | Status: closed
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: fixed | 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

#13541: Make it easier to use the gold linker -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: feature request | Status: closed Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | 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 bgamari): comment:33 merged to `ghc-8.2` in c23a84d58e348d51632dfcafff81a2c94abcab0b. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13541#comment:34 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13541: Make it easier to use the gold linker
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature request | Status: closed
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: fixed | 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
participants (1)
-
GHC