Skip to content

Commit defbe81

Browse files
committed
Fix suffixSalt calculation
1 parent f93c3b8 commit defbe81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/ghc/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,13 @@ stdenv.mkDerivation (rec {
395395
# We need to point at a stand in `windows.h` header file so that the RTS headers can
396396
# work on the hostPlatform. We also need to work around case sensitve file system issues.
397397
+ lib.optionalString stdenv.targetPlatform.isWindows ''
398-
export NIX_CFLAGS_COMPILE_${stdenv.hostPlatform.config}+=" -I${../windows/include}"
398+
export NIX_CFLAGS_COMPILE_${
399+
# We want this only to apply to the non windows hostPlatform (the
400+
# windows gcc cross compiler has a full `windows.h`).
401+
# This matches the way `suffixSalt` is calculated in nixpkgs.
402+
# See https://github.com/NixOS/nixpkgs/blob/8411006d6bcd7f6e6a8a1a80ce8fcdccdd16c6ab/pkgs/build-support/cc-wrapper/default.nix#L58
403+
replaceStrings ["-" "."] ["_" "_"] stdenv.hostPlatform.config
404+
}+=" -I${../windows/include}"
399405
if [[ -f libraries/base/include/winio_structs.h ]]; then
400406
substituteInPlace libraries/base/include/winio_structs.h --replace Windows.h windows.h
401407
fi

0 commit comments

Comments
 (0)