gcc: reconfigure build system

Split from #371092.

See <https://github.com/NixOS/nixpkgs/pull/371092/files#r2401287986> and
<https://wiki.debian.org/Autoreconf> for some rationale.

Co-Authored-By: Arsen Arsenović <arsen@aarsen.me>
This commit is contained in:
lzcunt
2026-01-06 00:56:31 +03:00
co-authored by Arsen Arsenović
parent db1801609d
commit cd3604f63a
3 changed files with 17 additions and 0 deletions
@@ -7,6 +7,7 @@
texinfo,
which,
gettext,
autoconf269,
gnused,
patchelf,
gmp,
@@ -41,6 +42,7 @@ in
texinfo
which
gettext
autoconf269
]
++ optionals (perl != null) [ perl ]
++ optionals (with stdenv.targetPlatform; isVc4 || isRedox || isSnapshot && flex != null) [ flex ]
@@ -80,6 +80,19 @@ lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export inhibit_libc=true
''
# We need to reconfigure the build system in case it has been patched. Since
# gcc is patched quite often, reconfiguring it unconditionally makes sense.
# This is also good practice for a couple other reasons.
# See <https://wiki.debian.org/Autoreconf>.
+ ''
for i in */configure.ac; do
pushd "$(dirname "$i")"
echo "Running autoreconf in $PWD"
autoconf -f
popd
done
''
+ lib.optionalString (
(!lib.systems.equals targetPlatform hostPlatform) && withoutTargetLibc && enableShared
) (import ./libgcc-buildstuff.nix { inherit lib stdenv; })
@@ -30,6 +30,7 @@
which,
patchelf,
binutils,
autoconf269,
isl ? null, # optional, for the Graphite optimization framework.
zlib ? null,
libucontext ? null,
@@ -131,6 +132,7 @@ let
# inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gcc${majorVersion}.cc.override)" | jq '.[]' --raw-output'
inherit
apple-sdk
autoconf269
binutils
buildPackages
cargo