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,323
    • Issues 4,323
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 372
    • Merge Requests 372
  • 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
  • #19009

Closed
Open
Opened Nov 28, 2020 by Sven Tennie@supersvenDeveloper

Add flag to show concrete calls to cc, as, ld, llc and opt

Motivation

While working on #18975 I realized that it can be really helpful to see how cc, as, ld, llc and opt are called by GHC.

This especially helped me to figure out some ABI and ISA issues.

Proposal

To help myself, I've added some quick&dirty prints:

builderMainLoop :: DynFlags -> (String -> String) -> FilePath
                -> [String] -> Maybe FilePath -> Maybe [(String, String)]
                -> IO ExitCode
builderMainLoop dflags filter_fn pgm real_args mb_cwd mb_env = do
  print "--------------------------------------------------------"
  print pgm
  print real_args
  print "--------------------------------------------------------"

(Process.hs)

This leads to outputs like:

...
"--------------------------------------------------------"
"/home/sven/src/llvm-project/build/bin/opt"
["-mem2reg","-globalopt","-lower-expect","-enable-tbaa","-tbaa","-relocation-model=pic","utils/hsc2hs/src/HSCParser.ll","-o","/home/sven/tmp/ghc/ghc18633_0/ghc_2.bc"]
"--------------------------------------------------------"
"--------------------------------------------------------"
"/home/sven/src/llvm-project/build/bin/llc"
["-O1","-enable-tbaa","-relocation-model=pic","-mcpu=mips64r2","-mattr=-noabicalls,+xgot,+long-calls","-force-mips-long-branch","/home/sven/tmp/ghc/ghc18633_0/ghc_2.bc","-o","/home/sven/tmp/ghc/ghc18633_0/ghc_3.lm_s"]
"--------------------------------------------------------"
"--------------------------------------------------------"
"mips64el-unknown-linux-gnu-cc"
["-iquoteutils/hsc2hs/src","-Iutils/hsc2hs/dist-install/build","-Iutils/hsc2hs/dist-install/build/hsc2hs/autogen","-Iutils/hsc2hs/dist-install/build","-no-pie","-fPIC","-U__PIC__","-D__PIC__","-mips64r2","-x","assembler","-c","utils/hsc2hs/src/HSCParser.s","-o","utils/hsc2hs/dist-install/build/HSCParser.o.tmp"]
...

I think it would be useful to enable similar debugging output with a flag.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#19009