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

Fix cross-compilation for armv6l #480

Merged
merged 8 commits into from
Mar 11, 2020

Conversation

michivi
Copy link
Contributor

@michivi michivi commented Mar 9, 2020

This PR adds a patch for GHC 8.6.5 to properly remove the atomic primops fallbacks on ARM architectures. Those primops called some GCC legacy synchronization functions that were not loaded during TH, ending in failure within remote-iserv. It turns out that the condition !defined(arm_HOST_ARCH) was never true, as arm_HOST_ARCH was actually defined (on ARM architectures) in a dependency of the Rts.h file.

This patch works for my use case (GHC 8.6.5 for armv6l). I haven't done any test on the other GHC versions.

This PR also includes a patch to actually use the native pkgconfig during cross-compilation.

Fixes #441

@angerman
Copy link
Collaborator

LGTM

iohk-bors bot added a commit that referenced this pull request Mar 10, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Mar 10, 2020

try

Timed out

@hamishmack
Copy link
Collaborator

bors try

iohk-bors bot added a commit that referenced this pull request Mar 11, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Mar 11, 2020

@hamishmack hamishmack merged commit 8099da8 into input-output-hk:master Mar 11, 2020
hamishmack pushed a commit that referenced this pull request Oct 14, 2020
Fixes the #441 issue with GHC 8.8.3 (fix that was already applied to GHC 8.6.5 with PR #480).

Testing environment:

- GHC 8.8.3 (cross-compiler)
- NixOS 20.03
- Building host: x86_64
- Target host: armv6l

Without this PR, the symbol `__sync_val_compare_and_swap_8` was not found by `remote-iserv` as described in #441 but this time with GHC 8.8.3. The 8.6.5 patch also works for 8.8.3. Perhaps it would be preferable to apply this patch to a range of GHC versions rather than specific versions, but I have only tested it and verified that it works properly on those specific versions.

I have not submitted this patch to the GHC GitLab as I haven't encountered any problem building a cross-compiling version of GHC from there.
booniepepper pushed a commit to booniepepper/haskell.nix that referenced this pull request Feb 4, 2022
…tput-hk#857)

Fixes the input-output-hk#441 issue with GHC 8.8.3 (fix that was already applied to GHC 8.6.5 with PR input-output-hk#480).

Testing environment:

- GHC 8.8.3 (cross-compiler)
- NixOS 20.03
- Building host: x86_64
- Target host: armv6l

Without this PR, the symbol `__sync_val_compare_and_swap_8` was not found by `remote-iserv` as described in input-output-hk#441 but this time with GHC 8.8.3. The 8.6.5 patch also works for 8.8.3. Perhaps it would be preferable to apply this patch to a range of GHC versions rather than specific versions, but I have only tested it and verified that it works properly on those specific versions.

I have not submitted this patch to the GHC GitLab as I haven't encountered any problem building a cross-compiling version of GHC from there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross-compilation failure with remote-iserv
3 participants