Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psx: work-around hsc2hs linking issue #60

Merged
merged 1 commit into from
Mar 31, 2024
Merged

Conversation

NicolasT
Copy link
Owner

On some platforms, building a hsc2hs program requires libgcc, and on some platforms, libgcc uses sigfillset. For some reason (a bug, I'd say), cabal passes ld-options to the compiler when building the generated C file. In our case, this causes sigfillset to be wrapped (which is desired for the actual psx library), but since __wrap_sigfillset is never defined, the build fails.

This work-around tells hsc2hs to include a small C file in its generated sources which defines __wrap_sigfillset as a proxy for __real_sigfillset.

See: haskell/cabal#8824

@NicolasT NicolasT added bug Something isn't working enhancement New feature or request labels Mar 31, 2024
@NicolasT NicolasT force-pushed the hsc2hs-linkage-issue branch from 24242a5 to 035dacf Compare March 31, 2024 23:00
On some platforms, building a `hsc2hs` program requires `libgcc`, and on
some platforms, `libgcc` uses `sigfillset`. For some reason (a bug, I'd
say), `cabal` passes `ld-options` to the compiler when building the
generated C file. In our case, this causes `sigfillset` to be wrapped
(which is desired for the actual `psx` library), but since
`__wrap_sigfillset` is never defined, the build fails.

This work-around tells `hsc2hs` to include a small C file in its
generated sources which defines `__wrap_sigfillset` as a proxy for
`__real_sigfillset`.

This requires the Cabal format to be bumped to 3.6.

See: haskell/cabal#8824
@NicolasT NicolasT force-pushed the hsc2hs-linkage-issue branch from 035dacf to 49f6643 Compare March 31, 2024 23:02
@NicolasT NicolasT merged commit 2952337 into main Mar 31, 2024
18 checks passed
@NicolasT NicolasT deleted the hsc2hs-linkage-issue branch March 31, 2024 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant