Skip to content

Commit

Permalink
gcc: fix c++ headers when same triplet cross compiling
Browse files Browse the repository at this point in the history
When build platform and host platform differ, but have the same
triple, the code in nixpkgs will consider it a cross compilation,
but gcc won't. This will lead some derivations to look for c++
headers in the wrong place. To solve this always output the headers
in the non-cross location, like we do for the other gcc headers
already.
  • Loading branch information
uri-canva authored and Adam Joseph committed Jan 18, 2024
1 parent 49467e7 commit 1cf2d73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/development/compilers/gcc/common/configure-flags.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ let
# We pick "/" path to effectively avoid sysroot offset and make it work
# as a native case.
"--with-build-sysroot=/"
# Same with the stdlibc++ headers embedded in the gcc output
"--with-gxx-include-dir=${placeholder "out"}/include/c++/${version}/"
]

# Basic configuration
Expand Down

1 comment on commit 1cf2d73

@adamcstephens
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the root case, but this commit broke lxc on aarch64 as docbook2man version is no longer correctly detected through meson. It all seems a bit odd to me, and slightly disconcerting, but I've patched around it in lxc for now

#285280

Please sign in to comment.