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
  • #20583
Closed
Open
Created Oct 30, 2021 by Cheng Shao@TerrorJackDeveloper

GHC should avoid going through assembler when compiling C

Motivation

Currently, when compiling a C file, be it coming from command line or unregisterised codegen, the GHC driver will first invoke the C compiler with -x c flags to emit an assembly file, then compile this assembly file to generate the object file. The reason of this two step distinction is merely historical, and we should call the C compiler to emit the object file in a single invocation:

  • Compared to generating assembly file first, this should be always slightly faster.
  • For certain architectures (e.g. wasm32), the assembler is very fragile and error-prone.

Proposal

Change the GHC driver behavior, when compiling C, call the C compiler to generate the object file in a single invocation.

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