libffi.a is unnecessarily duplicated
While looking into the build system logic for libffi
I noticed that the static archive built in the non---with-system-libffi
case is duplicated nearly a dozen times. This seems to be because Cffi
is added to the Cabal extra-bundled-libraries
field, which for some reason adds it to hs-libraries
in the package registration (as documented in the Cabal user's guide). hs-libraries
is a list of objects which are treated as linkables in the final link but, because they are Haskell objects, must carry a way suffix (as described in https://gitlab.haskell.org/ghc/ghc/-/blob/d99fc2508204c59cfc83d8a68718cf930ccc74b2/docs/users_guide/packages.rst#L1351).
This is very strange since libffi
isn't a Haskell object. Is there a reason why this is necessary? It would be nice if we didn't need to package libffi
a dozen identical times.