Skip to content

Commit

Permalink
klibc: Don't use crossAttrs
Browse files Browse the repository at this point in the history
  • Loading branch information
hSloan authored and Ericson2314 committed Jun 29, 2017
1 parent 16781a3 commit a210b08
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pkgs/os-specific/linux/klibc/default.nix
@@ -1,4 +1,6 @@
{ stdenv, fetchurl, linuxHeaders, perl }:
{ stdenv, fetchurl, linuxHeaders, perl
, buildPlatform, hostPlatform
}:

let
commonMakeFlags = [
Expand All @@ -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 = ''
Expand Down

0 comments on commit a210b08

Please sign in to comment.