Skip to content

Fix aarch64 musl TH code that uses C++ #2412

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

Merged
merged 3 commits into from
Jul 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builder/comp-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ let
}
// lib.optionalAttrs stdenv.hostPlatform.isMusl {
# This fixes musl compilation of TH code that depends on C++ (for instance TH code that uses the double-conversion package)
LD_LIBRARY_PATH="${pkgs.buildPackages.gcc-unwrapped.lib}/x86_64-unknown-linux-musl/lib";
LD_LIBRARY_PATH="${pkgs.buildPackages.gcc-unwrapped.lib}/${stdenv.hostPlatform.config}/lib";
}
// lib.optionalAttrs dontUpdateAutotoolsGnuConfigScripts {
inherit dontUpdateAutotoolsGnuConfigScripts;
Expand Down
2 changes: 1 addition & 1 deletion test/cabal.project.local
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repository head.hackage.ghc.haskell.org
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
--sha256: sha256-3icOgmtUh9WxDFfmmSHgTKhlfWJ6Yb5jYGYBcnK7d0A=
--sha256: sha256-ywti4TWiuFGJtnHaMMPhk3Ms2hXfsXMC1LMcWnI9K6I=

repository ghcjs-overlay
url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b
Expand Down
8 changes: 6 additions & 2 deletions test/th-dlls/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ let

in recurseIntoAttrs {
meta.disabled = stdenv.hostPlatform.isGhcjs
# On aarch64 this test also breaks form musl builds (including cross compiles on x86_64-linux)
|| (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl)
# On aarch64 this test breaks form musl cross compiles on x86_64-linux
# Error is:
# iserv-proxy-interpreter: internal error: 0x0 address for .LANCHOR1 + 0 of type 562
# in tmp/nix/store/kgprix3jn2w320flxpf7yr29f7dczykr-libsodium-aarch64-unknown-linux-musl-1.0.18/lib/libsodium.a
# (#103:librdrand_la-randombytes_internal_random.o) for relocation 4 in section 1 of kind: 0
|| (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl && !stdenv.buildPlatform.isAarch64)
# Not sure why this is failing with a seg fault
|| (builtins.elem compiler-nix-name ["ghc9102" "ghc9102llvm"] && stdenv.hostPlatform.isAndroid && stdenv.hostPlatform.isAarch32)
# unhandled ELF relocation(Rel) type 10
Expand Down
Loading