From 1cf2d7357c61b9c9ca5c92cb0e810571edee948a Mon Sep 17 00:00:00 2001 From: Uri Baghin Date: Thu, 29 Jun 2023 09:11:55 +1000 Subject: [PATCH] gcc: fix c++ headers when same triplet cross compiling 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. --- pkgs/development/compilers/gcc/common/configure-flags.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index cbe38f1127f3..75204a91273f 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -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