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 Nov 9, 2023
1 parent 6247bd0 commit 915fccb
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

0 comments on commit 915fccb

Please sign in to comment.