Add flag to show concrete calls to cc, as, ld, llc and opt
Motivation
While working on #18975 (closed) 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 print
s:
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.