Skip to content

Commit

Permalink
stdenv: xgcc: pass a valid --sysroot= when invoking xgcc
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Joseph committed Feb 1, 2023
1 parent 1e331cf commit 3e347a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkgs/stdenv/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ let

cc = if prevStage.gcc-unwrapped == null
then null
else lib.makeOverridable (import ../../build-support/cc-wrapper) {
else (lib.makeOverridable (import ../../build-support/cc-wrapper) {
name = "${name}-gcc-wrapper";
nativeTools = false;
nativeLibc = false;
Expand All @@ -191,7 +191,11 @@ let
inherit lib;
inherit (prevStage) coreutils gnugrep;
stdenvNoCC = prevStage.ccWrapperStdenv;
};
}).overrideAttrs(a: lib.optionalAttrs (prevStage.gcc-unwrapped.pname or "" == "xgcc") {
postFixup = (a.postFixup or "") + ''
echo "--sysroot=${lib.getDev (getLibc prevStage)}" >> $out/nix-support/cc-cflags
'';
});

overrides = self: super: {
inherit (prevStage) perl; # only build perl *once*
Expand Down

0 comments on commit 3e347a5

Please sign in to comment.