nixpkgs/pkgs
Sergei Trofimovich ea8e124000 gcc: always enable inhibit_libc=true for --without-headers builds
It's a follow-up to the breakage caused by 21966e13d2
("gcc: pass --with-build-sysroot=/"). It caused `pkgsLLVM`
cross-toolchain bootstrap breakage:

    $ nix build --no-link -f. pkgsLLVM.hello
    ...
    failed: /nix/store/...-x86_64-unknown-linux-gnu-stage-static-gcc-13.0.0.drv:
    ...
    configure flags: ... --enable-languages=c --disable-multilib \
      --disable-shared --enable-plugin ... --disable-libssp --disable-nls \
      --without-headers --disable-threads --disable-libgomp --disable-libquadmath \
      --disable-shared --disable-libatomic --disable-decimal-float --disable-libmpx \
      --disable-bootstrap \
      \
      --build=x86_64-unknown-linux-gnu \
      --host=x86_64-unknown-linux-gnu \
      --target=x86_64-unknown-linux-gnu
    ...
    The directory that should contain system headers does not exist:
      /usr/include
    make[2]: *** [Makefile:3279: stmp-fixinc] Error 1 shuffle=1658621302
    rm gfdl.pod gcc.pod gcov-dump.pod gcov-tool.pod fsf-funding.pod gpl.pod cpp.pod gcov.pod lto-dump.pod
    make[2]: Leaving directory '/build/build/gcc'

Note: it's a no-libc build. It's not expected to use any libc headers.
But in this case fixincludes tries to run and uses default /usr/include
location.

Fixinsludes is not normally expected to run during cross-compilation
on --without-headers. gcc/configure.ac:

    : ${inhibit_libc=false}
    if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
           test x$with_newlib = xyes ; } &&
         { test "x$with_headers" = xno || test ! -f "$target_header_dir/stdio.h"; } ; then
           inhibit_libc=true
    fi

The change explicitly passes inhibit_libc=true to configure to disable
include fixing on such cases.

Fixed `nix build --no-link -f. pkgsLLVM.hello` toolchain bootstrap.
2022-07-24 09:54:49 +01:00
..
applications Merge master into staging-next 2022-07-23 12:01:31 +00:00
build-support Merge pull request #181943 from trofi/fix-cross-built-gcc 2022-07-23 23:52:07 -04:00
common-updater
data Merge pull request #182183 from kilianar/orchis-theme-2022-07-20 2022-07-23 11:31:29 +08:00
desktops Merge branch 'master' into staging-next 2022-07-22 18:23:16 +03:00
development gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
games osu-lazer: 2022.719.0 -> 2022.723.0 2022-07-23 10:25:33 +02:00
misc cnijfilter2: 6.10 -> 6.40 (#180681) 2022-07-22 22:16:37 +02:00
os-specific Merge staging-next into staging 2022-07-23 06:02:03 +00:00
pkgs-lib
servers Merge master into staging-next 2022-07-23 12:01:31 +00:00
shells
stdenv Merge pull request #179603 from Artturin/subplacemultiple 2022-07-24 04:14:09 +03:00
test
tools Merge master into staging-next 2022-07-23 12:01:31 +00:00
top-level Merge staging-next into staging 2022-07-23 12:02:12 +00:00