nix: fix unicorn build on 32bit systems (#2737)

* nix: fix unicorn build on 32bit systems

* nix: fix unicorn build on 32bit systems
pull/2539/head
patryk4815 10 months ago committed by GitHub
parent c64aaa1a93
commit f85ac5e825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -55,7 +55,7 @@
"riscv64" = "riscv64";
"s390x" = "s390x";
"ppc64" = "ppc64";
"ppc64le" = "powernv"; # broken gdb ;(
"ppc64le" = "powernv"; # broken gdb ;(
"loong64" = "loongarch64-linux"; # broken stdenv: https://github.com/NixOS/nixpkgs/issues/380901
};
mapKeysWithName =

@ -208,6 +208,10 @@ let
prev.unicorn.overrideAttrs (
old:
lib.optionalAttrs ((isBuildSource old)) {
# On 32bit system failed to build: https://github.com/pwndbg/pwndbg/issues/2588#issuecomment-2659498870
# Since GCC-14 `-Wreturn-mismatch` is turned into an error by default.
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.is32bit "-Wno-return-mismatch";
nativeBuildInputs =
old.nativeBuildInputs
++ [
@ -219,9 +223,9 @@ let
];
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace ./src/CMakeLists.txt \
--replace-fail 'set(CMAKE_C_COMPILER "/usr/bin/cc")' 'set(CMAKE_C_COMPILER "${stdenv.cc}/bin/cc")' || true
'';
substituteInPlace ./src/CMakeLists.txt \
--replace-fail 'set(CMAKE_C_COMPILER "/usr/bin/cc")' 'set(CMAKE_C_COMPILER "${stdenv.cc}/bin/cc")' || true
'';
}
)
) { };

Loading…
Cancel
Save