Skip to content

fix(gnu.org/gcc): wire libc + linux-headers (closes #8423)#13084

Closed
tannevaled wants to merge 2 commits into
pkgxdev:mainfrom
tannevaled:fix/gcc-glibc-dep
Closed

fix(gnu.org/gcc): wire libc + linux-headers (closes #8423)#13084
tannevaled wants to merge 2 commits into
pkgxdev:mainfrom
tannevaled:fix/gcc-glibc-dep

Conversation

@tannevaled
Copy link
Copy Markdown
Contributor

Summary

Implements the pkgx-integrated approach: resolve from-source toolchain problems with versions bundled in pkgx rather than depending on host packages.

Test plan

  • CI builds gcc on linux/x86-64 + linux/aarch64
  • Manual: on a stock Fedora image without glibc-devel, pkgx gcc test.c -o test succeeds
  • Manual: pkgx gcc -print-search-dirs shows the bottled glibc lib path
  • Confirm darwin builds unchanged

🤖 Generated with Claude Code

tannevaled and others added 2 commits May 29, 2026 17:09
Adds gnu.org/glibc + kernel.org/linux-headers as Linux runtime deps,
and runtime.env CPATH/LIBRARY_PATH so end-user `pkgx gcc test.c`
resolves stdlib.h, crt*.o, libc.so.6 from the pkgx-integrated bottle —
without needing distro glibc-devel / libc6-dev (fixes Fedora repro
in pkgxdev#8423).

Pairs with pkgxdev#13083 (multi-arch triplet symlinks) to fully close pkgxdev#8423.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The runtime.env CPATH/LIBRARY_PATH leaked into gcc's own build (because
gcc bootstrap-depends on gcc), replacing brewkit's composed CPATH with
just glibc's include dir — and configure then couldn't find gmp.h:

    checking for the correct version of gmp.h... no
    configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.

The Linux glibc + linux-headers deps remain (they help downstream
packages link against the pkgx-integrated libc). The end-user CPATH
problem from pkgxdev#8423 needs a non-self-referential mechanism (configure
flag like --with-native-system-header-dir, or a wrapper script).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tannevaled
Copy link
Copy Markdown
Contributor Author

Closing — adding gnu.org/glibc as a build dep caused gcc's own fixincludes link to fail with undefined reference to __isoc23_strtoul (newer glibc 2.43 headers reference C23 symbols absent in the CI runner's older glibc). The end-user CPATH problem from #8423 needs a different mechanism (wrapper script per the bklibcvenv pattern, or --with-native-system-header-dir at configure-time). Will revisit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistencies with dnf/apt install gcc

1 participant