diff options
-rw-r--r-- | pkgs/os-specific/linux/klibc/default.nix | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index 84b66ac0d9c7..92ac1a77898c 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, linuxHeaders, perl }: +{ stdenv, fetchurl, linuxHeaders, perl +, buildPlatform, hostPlatform +}: let commonMakeFlags = [ @@ -23,17 +25,12 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" "stackprotector" ]; makeFlags = commonMakeFlags ++ [ - "KLIBCARCH=${stdenv.platform.kernelArch}" + "KLIBCARCH=${hostPlatform.platform.kernelArch}" "KLIBCKERNELSRC=${linuxHeaders}" - ] ++ stdenv.lib.optional (stdenv.platform.kernelArch == "arm") "CONFIG_AEABI=y"; - - crossAttrs = { - makeFlags = commonMakeFlags ++ [ - "KLIBCARCH=${stdenv.cross.platform.kernelArch}" - "KLIBCKERNELSRC=${linuxHeaders.crossDrv}" - "CROSS_COMPILE=${stdenv.cross.config}-" - ] ++ stdenv.lib.optional (stdenv.cross.platform.kernelArch == "arm") "CONFIG_AEABI=y"; - }; + ] # TODO(@Ericson2314): We now can get the ABI from + # `hostPlatform.parsed.abi`, is this still a good idea? + ++ stdenv.lib.optional (hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y" + ++ stdenv.lib.optional (hostPlatform != buildPlatform) "CROSS_COMPILE=${stdenv.cc.prefix}"; # Install static binaries as well. postInstall = '' |