Skip to content
GitLab
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 5,357
    • Issues 5,357
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 566
    • Merge requests 566
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20162
Closed
Open
Issue created Jul 25, 2021 by Ben Gamari@bgamari🐢Maintainer

GHC should pass --target to CC when available

Currently GHC assumes that multi-platform toolchain support is implemented via target-prefixed toolchain binaries (e.g. x86_64-unknown-linux-cc). However, modern Darwin distributions rather ship with a single clang binary which is runtime-retargetable via the --target=<triple> flag. In cases where no --target flag is provided the toolchain compiles for the native platform of the slice which was executed. Unfortunately, it is hard to predict which slice will be executed as it appears to depend upon whether any process in the parent hierarchy is executed via Rosetta. This means that using an x86-64 cabal install to invoke an AArch64 ghc will result in assembler errors as CC tries to compile the AArch64 assembly produced by GHC as x86-64 syntax.

To avoid this we should test whether the toolchain supports --target and pass it when necessary.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking