Skip to content

-staticlib with -v does not dump archive inputs

When I create a static archive with -staticlib and pass -v, I'd expect the verbose log to tell me which archives and objects go into the output archive. But the log entry is missing. For instance:

$ touch test.c
$ ghc -staticlib -o test.a test.c -v
Glasgow Haskell Compiler, Version 9.4.3, stage 2 booted by GHC version 9.2.2
Created temporary directory: /tmp/tmp.7Q1ncvtL4y/ghc226_0
*** systool:cc:
*** C Compiler:
/usr/lib/llvm-15/bin/clang -x c test.c -o /tmp/tmp.7Q1ncvtL4y/ghc226_0/ghc_1.s -fno-PIC -Wimplicit -S -include /home/gitpod/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/lib/../lib/x86_64-linux-ghc-9.4.3/rts-1.0.2/include/ghcversion.h -I/home/gitpod/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/lib/../lib/x86_64-linux-ghc-9.4.3/base-4.17.0.0/include -I/home/gitpod/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/lib/../lib/x86_64-linux-ghc-9.4.3/ghc-bignum-1.3/include -I/home/gitpod/.ghcup/ghc/9.4.3/lib/ghc-9.4.3/lib/../lib/x86_64-linux-ghc-9.4.3/rts-1.0.2/include -Wno-unused-command-line-argument '--target=x86_64-unknown-linux'
!!! systool:cc: finished in 0.98 milliseconds, allocated 0.267 megabytes
*** systool:as:
*** Assembler:
/usr/lib/llvm-15/bin/clang '--target=x86_64-unknown-linux' -Wno-unused-command-line-argument -fno-PIC -Qunused-arguments -x assembler -c /tmp/tmp.7Q1ncvtL4y/ghc226_0/ghc_1.s -o test.o.tmp
!!! systool:as: finished in 0.71 milliseconds, allocated 0.116 megabytes
*** systool:ranlib:
*** Ranlib:
/usr/lib/llvm-15/bin/llvm-ranlib test.a
!!! systool:ranlib: finished in 0.54 milliseconds, allocated 0.095 megabytes
*** Deleting temp files:
Deleting: /tmp/tmp.7Q1ncvtL4y/ghc226_0/ghc_1.s /tmp/tmp.7Q1ncvtL4y/ghc226_0/ghc_2.rsp
*** Deleting temp dirs:
Deleting: /tmp/tmp.7Q1ncvtL4y/ghc226_0

In the verbose log, there should be a step before Ranlib that describes the creation of archive file sans symbol index. Given -staticlib does not invoke external ar program and uses internal GHC.SysTools.Ar logic, this is understandably an oversight, but it should be fixed.

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