Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17266
Closed
Open
Created Sep 27, 2019 by andrewjcg@andrewjcg

Invalid 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 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_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking