nixpkgs/pkgs/development/compilers/gcc
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
..
4.8 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
4.9 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
6 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
7 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
8 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
9 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
10 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
11 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
12 gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
common gcc: always enable inhibit_libc=true for --without-headers builds 2022-07-24 09:54:49 +01:00
builder.sh pkgsStatic.stdenv.cc.cc: put static libs in $lib 2022-03-22 17:56:11 +00:00
gcc-12-gfortran-driving.patch gcc12, gfortran12, gnat12: init at 12.1.0 2022-05-07 13:50:47 +01:00
gcc-12-no-sys-dirs.patch gcc12, gfortran12, gnat12: init at 12.1.0 2022-05-07 13:50:47 +01:00
gfortran-darwin-NXConstStr.patch
gfortran-driving.patch
gnat-cflags-11.patch
gnat-cflags.patch
libgomp-dont-force-initial-exec.patch
libphobos.patch
libsanitizer-no-cyclades-9.patch
libsanitizer-no-cyclades.patch
libstdc++-netbsd-ctypes.patch
libstdc++-target.patch
no-sys-dirs-riscv-gcc9.patch gcc9: Add no-sys-dir patch for RISC-V (#154230) 2022-01-12 06:27:48 -05:00
no-sys-dirs-riscv.patch gcc{10,11}: add no-sys-dir patch for RiscV 2021-11-30 16:58:45 +08:00
no-sys-dirs.patch
parallel-bconfig.patch
ppc-musl.patch
res_state-not-declared.patch
sigsegv-not-declared.patch
struct-sigaltstack-4.9.patch
struct-sigaltstack.patch
struct-ucontext-4.5.patch
struct-ucontext-4.8.patch
struct-ucontext-libjava.patch
struct-ucontext.patch
update-mcfgthread-patches.sh
use-source-date-epoch.patch