Skip to content

Merge objects broken when `-L` is not supported (fallback case using ar)

It appears that attempting to created a shared library is broken in the case when using ar rather than ld -r in joinObjectFiles.

In particular this is observed when a module has a foreign export, the resulting shared object doesn't contain a symbol for the foreign export definition.

I would like to add a test for this, perhaps the easiest way (which doesn't require nm) is to attempt to link a C file which references the foreign export to the created shared library.

There is a cabal test for this, which has been broken since ghc-9.4, but only on windows as other platforms support merging objects via ld -r.

The GHC tests are not sufficient as they do not check the created shared object has the correct symbols.

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