-
Notifications
You must be signed in to change notification settings - Fork 239
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
Cross-compilation failure with remote-iserv #441
Comments
This sounds pretty similar to the stuff I did debug with @eamsden a while back... I don't really remember the reason anymore :-/ |
@michivi What git revision of Haskell.nix did you use? Is it more recent than (i.e. does it include) the commit 563e18c? This looks like one of the errors I was dealing with there: the main issue is that ghc doesn't build its core/boot libraries dynamically when nix sets it up for cross-compilation, so any other libraries that link to those (read, any libraries at all, pretty much) must also not be build dynamically. If you build with haskell.nix including that commit you should get static-only builds when cross-compiling to ARM. |
@eamsden @angerman I used the most recent version of Haskell.nix I could at that time: efb9a07. I believe it does include commit 563e18c. I also did a test without that commit a few weeks ago, with exactly the same results. Aside from the custom flags I've put for At first, I thought that was a problem in GHC (much like this 9886 GHC issue). But then, the patch |
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 Authored-by: Michivi <webmaster@michvi.com>
Fixes the input-output-hk#441 issue with GHC 8.8.3 (issue that was already applied to GHC 8.6.5)
Fixes the input-output-hk#441 issue with GHC 8.8.3 (fix that was already applied to GHC 8.6.5)
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.
…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.
Hi everyone,
I tried to cross-compile a Stack project for the Raspberry Pi (ARMv6l) but it fails with the following error:
The Stack project uses GHC 8.6.5 with the latest version of Haskell-Nix (at the time I wrote this issue), and I had to set the following flags as mentioned in #313 :
I tried cross-compiling the project to ARMv7l and the build ended properly.
Some investigations led me to believe that ghc-prim is using atomic builtin GCC functions that aren't defined for ARMv6l and were hence replaced with external function calls, which remote-iserv failed to find. If I am not mistaken, #387 did remove some of them (in
atomic.c
), but not the one defined inSMP.h
, when a threaded RTS is used.Have I overlooked something?
Thank you for your help
The text was updated successfully, but these errors were encountered: