stdenv: make -nostdinc work as intended

Right now we add glibc to search path also -nostdinc was provided,
which breaks projects providing their own gcc.
This commit is contained in:
Jörg Thalheim
2020-07-23 08:39:46 +01:00
parent 434a0111f6
commit 96092dc936
10 changed files with 41 additions and 17 deletions
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
# Figure out what extra flags to pass to the gcc compilers
# being generated to make sure that they use our glibc.
EXTRA_FLAGS="-I$NIX_FIXINC_DUMMY $(cat $NIX_CC/nix-support/libc-cflags) -O2"
EXTRA_FLAGS="-I$NIX_FIXINC_DUMMY $(cat $NIX_CC/nix-support/libc-crt1-cflags) $(cat $NIX_CC/nix-support/libc-cflags) -O2"
extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_BINTOOLS/nix-support/libc-ldflags) $(cat $NIX_BINTOOLS/nix-support/libc-ldflags-before)"
for i in $extraLDFlags; do