test-primops has started failing due to a link error
The test-primops job has started failing due to a link error for the last few days: https://gitlab.haskell.org/ghc/test-primops/-/jobs/2065089
1 of 1] Compiling Main ( Run.hs, /builds/ghc/test-primops/dist-newstyle/build/x86_64-linux/ghc-9.13.20241214/run-it-0.1.0.0/x/run-it/build/run-it/run-it-tmp/Main.dyn_o )
[2 of 2] Linking /builds/ghc/test-primops/dist-newstyle/build/x86_64-linux/ghc-9.13.20241214/run-it-0.1.0.0/x/run-it/build/run-it/run-it
/usr/bin/ld.gold: error: /builds/ghc/test-primops/dist-newstyle/build/x86_64-linux/ghc-9.13.20241214/run-it-0.1.0.0/x/run-it/build/run-it/run-it-tmp/Trampoline.o: multiple definition of 'stg_trampoline'
/usr/bin/ld.gold: /builds/ghc/test-primops/dist-newstyle/build/x86_64-linux/ghc-9.13.20241214/run-it-0.1.0.0/x/run-it/build/run-it/run-it-tmp/Trampoline.dyn_o: previous definition here
collect2: error: ld returned 1 exit status
ghc-9.13.20241214: Uncaught exception ghc-9.13-inplace:GHC.Utils.Panic.GhcException:
`gcc' failed in phase `Linker'. (Exit code: 1)
While handling `gcc' failed in phase `Linker'. (Exit code: 1)
HasCallStack backtrace:
bracket, called at compiler/GHC/Driver/Make.hs:3016:3 in ghc-9.13-inplace:GHC.Driver.Make
This occurs across GHC versions, from 9.6 to master. I can't see why this job has suddenly started failing as no configuration or code I can see has changed.
The following patch to test-primops/run-it
allows the link to succeed:
diff --git a/run-it/run-it.cabal b/run-it/run-it.cabal
index 536db9f..e5c4071 100644
--- a/run-it/run-it.cabal
+++ b/run-it/run-it.cabal
@@ -12,7 +12,6 @@ executable run-it
main-is: Run.hs
cmm-sources: Trampoline.cmm
-- silly Cabal doesn't link cmm-sources into executables
- ghc-options: Trampoline.cmm
build-depends: base,
unix,
mmap