Skip to content

Commit

Permalink
ubootTools: fix build by fixing -idirafter ordering
Browse files Browse the repository at this point in the history
`ubootTools` build broke after NixOS#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.
  • Loading branch information
trofi committed Jan 27, 2023
1 parent 578f1ba commit 49c098e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/misc/uboot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ 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
preConfigure = ''
export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] stdenv.hostPlatform.config}=$(< ${stdenv.cc}/nix-support/libc-cflags)
'';

configurePhase = ''
runHook preConfigure
Expand Down

0 comments on commit 49c098e

Please sign in to comment.