diff options
author | Sergei Trofimovich <slyich@gmail.com> | 2023-01-27 07:59:13 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyich@gmail.com> | 2023-01-27 08:32:06 +0000 |
commit | 8b3a31f923662bc3003be4943bc382c46136cb5f (patch) | |
tree | 152b1aa7951d877c8b1050dd800584e067b9aaed /pkgs/misc/uboot | |
parent | 578f1ba854d2c4d5a628c2749558e89dd38359eb (diff) |
ubootTools: fix build by fixing -idirafter ordering
`ubootTools` build broke after https://github.com/NixOS/nixpkgs/pull/210004 where we started dropping default libc include path and switched to `-idirafter` way of specifying libc headers. Unfortunately the way it's implemented it injects -idirafter after user's flags, not before. That allows users to inject their paths before libc include paths, not after (as it would notmally happen). The change works it around for u-boot by pulling -idirafter libc flags before user's flags.
Diffstat (limited to 'pkgs/misc/uboot')
-rw-r--r-- | pkgs/misc/uboot/default.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index a360058725006..42d7021f3452b 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -92,6 +92,16 @@ let passAsFile = [ "extraConfig" ]; + # Workaround '-idirafter' ordering bug in staging-next: + # https://github.com/NixOS/nixpkgs/pull/210004 + # where libc '-idirafter' gets added after user's idirafter and + # breaks. + # TODO(trofi): remove it in staging once fixed in cc-wrapper. + preConfigure = '' + export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] buildPackages.stdenv.hostPlatform.config}=$(< ${buildPackages.stdenv.cc}/nix-support/libc-cflags) + export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] stdenv.hostPlatform.config}=$(< ${stdenv.cc}/nix-support/libc-cflags) + ''; + configurePhase = '' runHook preConfigure |