Skip to content

Commit 42ca2fa

Browse files
authored
libamplsolver: fix build on non-trapping FP architectures (#478259)
2 parents bee157d + 17e7bfb commit 42ca2fa

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkgs/by-name/li/libamplsolver/package.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ stdenv.mkDerivation {
2525
})
2626
];
2727

28-
# Allow install_name_tool rewrite paths on darwin.
29-
# error: install_name_tool: changing install names or rpaths can't be redone for: /nix/store/...-libamplsolver-.../lib/libamplsolver.dylib (for architecture arm64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
30-
NIX_LDFLAGS = lib.optional stdenv.hostPlatform.isDarwin "-headerpad_max_install_names";
28+
env = {
29+
# For non-trapping FP architectures like loongarch64 and riscv64
30+
NIX_CFLAGS_COMPILE = lib.optionalString (
31+
stdenv.hostPlatform.isRiscV64 || stdenv.hostPlatform.isLoongArch64
32+
) "-DNO_fpu_control";
33+
# Allow install_name_tool rewrite paths on darwin.
34+
# error: install_name_tool: changing install names or rpaths can't be redone for: /nix/store/...-libamplsolver-.../lib/libamplsolver.dylib (for architecture arm64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
35+
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-headerpad_max_install_names";
36+
};
3137

3238
installPhase = ''
3339
runHook preInstall

0 commit comments

Comments
 (0)