gcc47
- Path: arch/adapted/gcc47
- 2026-07-15: build failure fixed,
pkgrel3 -> 2.1 (per this project’sadapted/X.Y sub-versioning convention, seePKGREL_VS_PKGVER.md– initially bumped to a plain4in error, corrected by the user afterward; already published as2.1). The 4 missing texinfo patches described below were never restored – instead, noticedpackage()already doesrm -rf "${pkgdir}/usr/share/"right after install, so generated docs (infodir/mandir, both under/usr/share) never actually ship in the package regardless of whethermakeinfosucceeds. Simplest fix: don’t generate docs at all rather than resurrect 4 missing patches for output that gets deleted anyway. Removed the 4 dangling patch references fromsource=()/md5sums=()/sha256sums=()/prepare(), and addedMAKEINFO=':'to theconfigureinvocation inbuild()’s_confarray (a no-op instead of the realmakeinfo). - Also hit, separately:
depends=()includescloog, which only exists in this project’s ownarchlinuxabarepo, not officialcore/extra– so the plainextra-x86_64-buildchroot (no private repo configured) can’t resolve it (error: target not found: cloog). Had to usescripts/archlinuxaba-x86_64-buildinstead (adds this project’s own repo to the chroot’spacman.conf, see that script’s own header) – same reasonrepo_build.shalready uses it for x86_64 internally. If testing this package with a plainextra-x86_64-buildby hand, remember it’ll fail for this reason alone, unrelated to any PKGBUILD bug. - Test-built clean with
scripts/archlinuxaba-x86_64-build(0 compiler errors; bothgcc47andgcc47-debugpackages produced, ~10MB / 46MB). Built+signed+published to the private repo (x86_64). - Symlink issue (see above) is now fixed –
package()already contains theln -s 'lib/libgcc_s.so.1' ".../${pkgver}/libgcc_s.so"fix as of 2026-08-17 (found already in place, presumably added in an intervening session not reflected here).
Superseded (kept for context – the fix above addressed this)
- Build failure during the 2026-07-07 “build all packages for x86_64”
private-repo release pass (see
repo_release_logs/adapted_gcc47.log). PKGBUILD’ssource=()array (lines 25-31) lists four local texinfo patch files thatprepare()applies withpatch -Nup1 -i "${srcdir}/<name>":gcc.texi.49.patch,0000-sourcebuild.texi-itemx.patch,0001-tm.texi-end-deftypevr.patch,0002-invoke.texi-tie.patch. None of these four files actually exist in the package directory – onlygcc-4.7.4-gcc-15-compilation.patch(a different, present patch) and the downloadedgcc-4.7.4.tar.bz2are there. makepkg fails immediately at source retrieval:gcc.texi.49.patch was not found in the build directory and is not a URL.- This is a genuine defect in the tracked package tree (missing local
source files), not a build-environment or toolchain issue, and not
something introduced by this release pass. Needs the four patch files
restored (from wherever they were originally generated – the comment
above the patch block says
gcc.texi.49.patchwas hand-generated viadiff -pNau5 gcc/doc/gcc.texi{,.49}, so it may need regenerating rather than recovering from history) before this package can build again. - Not fixed as part of the mass build pass – flagging only, since PKGBUILD repair (regenerating/sourcing 4 missing patches) is out of scope for a build+sign+publish run.
2026-08-17: i686/pentium4 attempted, reverted to x86_64-only
arch=()hadi686declared already (from before this session) but it had apparently never actually built/published – only x86_64 packages ever existed on the repo. Addedpentium4too and attempted a real build for both 32-bit arches for the first time.Both failed identically, deep in the stage1 bootstrap (
all-stage1-target-libgcc/install-shared):rm: .../gcc-build/./gcc/libgcc_s.so.1: version `GCC_7.0.0' not found (required by /usr/lib/libstdc++.so) ln: .../gcc-build/./gcc/libgcc_s.so.1: version `GCC_7.0.0' not found (required by /usr/lib/libstdc++.so)The dynamic linker fails to even run
rm/lnthemselves mid-build: something in the build environment (likelyLD_LIBRARY_PATHpollution from the stage1 build-tree search path, gcc47 being a vintage-2012 GCC self-hosting against this chroot’s much newer hostlibstdc++) makes those coreutils resolve against the freshly-built (ancient, GCC_7.0.0-lacking) stage1libgcc_s.so.1instead of the system one. x86_64 doesn’t hit this (works fine both historically and in this session at pkgrel2.3).Not root-caused further (would need to trace exactly why the 32-bit build environment’s dynamic linker search order differs from x86_64’s for a self-referential build-tree
.so) – revertedarch=()back to('x86_64')only rather than chase a deep GCC-bootstrap/toolchain interaction bug, matching the project’s established “not every package is a good fit for 32-bit arch expansion” precedent (seefeedback_local_install_rebuilds.md).pkgrelstayed2.3(x86_64 was already correctly published at that pkgrel before the revert, no rebuild needed). If revisited, start by checking whetherLD_PRELOAD='/usr/lib/libstdc++.so'(already used inpackage()’smake install) also needs applying earlier, tobuild()’s bootstrapmakeinvocation.
2026-08-20: proper root-cause fix attempted – real progress, but a genuine bootstrap ABI conflict blocks 32-bit
- Root-caused the actual mechanism precisely this round (previous entry’s
LD_PRELOADtheory was a symptom description, not the real cause).gcc’s top-levelMakefile.inhasSTAGE1_LDFLAGS = @stage1_ldflags@, substituted at./configuretime from--with-stage1-ldflags(a real, documented GCC configure option – seeconfigure’sstage1_ldflags/poststage1_ldflagshandling). Its default is empty – unlikepoststage1_ldflags, which defaults to-static-libstdc++ -static-libgccautomatically for stage2/3 whenever--with-host-libstdcxxisn’t set. So stage1 host tools (cc1 etc) stay dynamically linked against libstdc++/libgcc by design, unless explicitly told not to. - First attempt: passed
STAGE1_LDFLAGS=...on the top-levelmakecommand line instead of viaconfigure. Didn’t work – confirmed vialdd/filethatcc1stayed dynamically linked. Root cause: that variable only seedsHOST_EXPORTS’LDFLAGSfor the stage1 “gcc” subdirectory’s own recursive./configure, and that subdirectory’s generatedgcc-build/gcc/Makefilebakes its ownLDFLAGSin at ITS configure time – a make-command-line override of the top-level variable doesn’t reliably reach that point. - Real fix: pass
--with-stage1-ldflags='-static-libstdc++ -static-libgcc'directly to the top-level../configureinvocation inbuild()’s_confarray (same mechanismpoststage1_ldflagsalready uses). Confirmed this genuinely worked this time: inspected the leftover chroot build tree after a failed i686 build (/var/lib/archbuild/archlinuxaba-i686/build/build/gcc47/...) –gcc-build/gcc/MakefilehasLDFLAGS = -static-libstdc++ -static-libgcc, andcc1itself (file/ldd) no longer listslibstdc++.so.6as a dynamic dependency at all.pkgrel2.4 -> 2.5. - This genuinely advanced the build – i686/pentium4 got much further
(all the way to cross-building
libstdc++-v3target libraries) before hitting a different occurrence of the same underlying class of bug: building libstdc++-v3’spo/translations (de.mo,fr.mo) runs the system’s real/usr/bin/msgfmt, itself dynamically linked against a modernlibicuuc.soneeding recentGLIBCXX_3.4.30/CXXABI_1.3.8/1.3.9symbols – but by that point in the build,HOST_LIB_PATH/TARGET_LIB_PATH(exported into the dynamic linker search path for every recursive sub-make invocation, intentionally, so xgcc/cc1 can find their own not-yet-installed support libs) has the in-progress, ABI-incomplete build-treelibstdc++.so.6ahead of the real system one, somsgfmtitself fails to even load. This one also broke x86_64, which had never hit it before (previously succeeded without ever reaching this translation-generation step in the same way). Fixed by adding--disable-nls– this package already strips/usr/share/wholesale inpackage()(same reasoning as the pre-existingMAKEINFO=:doc skip), so there’s no reason to generate translations either.pkgrel2.5 -> 2.6. x86_64 now builds and publishes cleanly again with both fixes applied (confirmed via a real rebuild+publish, pkgrel 2.6). - i686/pentium4 still fail, at the original libgomp stage1-configure
point, but the actual root cause is now precisely understood and is
a genuine, structural conflict rather than a fixable flag:
cc1(thanks to the stage1-ldflags fix) no longer needs libstdc++/libgcc directly.- But
cc1also dynamically linkslibgmpxx.so.4(GMP’s C++ bindings, pulled in transitively because this package builds with--with-ppl --enable-cloog-backend=isl, both PPL and CLooG using GMP’s C++ interface).libgmpxx.so.4is a pre-built system library we don’t control, and it dynamically needs the real systemlibstdc++.so.6, which in turn needslibgcc_s.so.1with theGCC_7.0.0symbol version. - The freshly-built, in-progress
libgcc_s.so.1sitting in the build tree (built from gcc-4.7.4’s own, 2012-eralibgccsources) can never provideGCC_7.0.0– that symbol-versioning scheme didn’t exist yet when 4.7’s libgcc sources were written. SinceHOST_LIB_PATHputs the build-tree copy ahead of the real system one in the search path (by design, for cc1’s OWN needs), any OTHER, unrelated consumer that also needs “libgcc_s.so.1” (like systemlibgmpxx’s dependency chain) gets the wrong, incompatible one instead. There’s no way to make both consumers happy via search-order tricks alone – both need a shared object with the exact same soname, but genuinely different, incompatible symbol versions. - This is a known, somewhat inherent problem class when
self-hosting/bootstrapping a ~decade-plus-old GCC using a very
modern host toolchain. A prior maintainer evidently anticipated
exactly this:
build()’s_confarray has commented-out#CXX='g++-4.9' CC='gcc-4.9'and a commented-out#makedepends+=('gcc49')– i.e. the standard real fix is bootstrapping with an intermediate host compiler (old enough to not needGCC_7.0.0, new enough to compile 4.7.4’s own sources) instead of the chroot’s current system gcc. That would needgcc49(or similar) built and published for i686/pentium4 too – a materially bigger undertaking, out of scope for this round. - Unclear why x86_64 doesn’t hit this exact conflict too (same
--with-ppl/CLooG flags, so presumably also linkslibgmpxx) – not investigated further; possibly the x86_64 chroot’s system toolchain/libstdc++ differs in some relevant way, or the specific configure check that fails first for libgomp happens not to exercise the same dependency chain there. Worth checking first if revisited.
- Reverted
arch=()back to('x86_64')only – matches the established “not every package is a good fit for 32-bit expansion” precedent (seefeedback_local_install_rebuilds.md,trojita-qt5-git’s Qt5-private-API blocker for a similar precedent).pkgrelstayed2.6(x86_64 already correctly rebuilt/republished at that pkgrel with both real fixes before the revert – narrowingarch=()alone needs no further rebuild). - Net result of this round: real, durable improvements shipped for
x86_64 (
--with-stage1-ldflagsis more correct/robust regardless of 32-bit;--disable-nlsfixed an actual x86_64 regression this investigation surfaced). 32-bit remains blocked on a well-understood, documented, but out-of-scope-for-now structural bootstrap conflict.