GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2020-01-07T04:30:48Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/17266Invalid PATH set for `-B` dirs when calling gcc to link2020-01-07T04:30:48ZandrewjcgInvalid PATH set for `-B` dirs when calling gcc to link## Summary
When `-B` values are set in `-optl`, GHC constructs a seemingly invalid `PATH` from it, using `;` instead of `:` to prepend to the existing `PATH`.
## Steps to reproduce
On a system where all executables needed to run GHC a...## Summary
When `-B` values are set in `-optl`, GHC constructs a seemingly invalid `PATH` from it, using `;` instead of `:` to prepend to the existing `PATH`.
## Steps to reproduce
On a system where all executables needed to run GHC are in `/bin`:
```
$ cat Main.hs
module Main where
main = return ()
$ PATH=/bin ghc -optl-B/var/tmp Main
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
collect2: fatal error: cannot find 'ld'
compilation terminated.
```
(`strace` shows `PATH="/var/tmp";/bin` being set in the environment).
## Expected behavior
Link sample program successfully.
## Environment
* GHC version used: 7.6.3 and 8.4.4
Optional:
* Operating System: linux
* System Architecture: x86_648.8.2