Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,248
    • Issues 4,248
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 391
    • Merge Requests 391
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9895

Closed
Open
Opened Dec 18, 2014 by erikd@trac-erikd

No -mtriple param being passed to opt/llc when cross compiling

Currently trying to build an x86_64-linu to arm64-linux cross-compiler.

After fixing some code in rts/StgCRun.c i ran into an issue where ghc was calling llc and generating x86_64 assembly instead of aarch64 assembly.

For now, I've hacked compiler/main/SysTools.hs to add -mtriple=aarch64-linux-gnu to the opt and llc command lines and that allows me to get a bit further in the compile process.

For cross-compiling, passing something like this -mtriple=... is pretty much mandatory. I suggest adding it by doing the following:

  • Add a crossCompiling :: Bool field to DynFlags.
  • Add the -mtriple=... string to the sOpt_lo and sOpt_lc fields of Settings when we are cross-compiling.
  • Possibly also store the triple string in the Platform struct.

Comments?

Trac metadata
Trac field Value
Version 7.9
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.10.2
Milestone
7.10.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#9895