From 19b2528cdc3045d31ed5acf64629b0f78bc350c2 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 17:09:39 +0200 Subject: [PATCH 1/2] fix(gnu.org/gcc): wire libc + linux-headers (closes #8423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #8423). Pairs with #13083 (multi-arch triplet symlinks) to fully close #8423. Co-Authored-By: Claude Opus 4.7 --- projects/gnu.org/gcc/package.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/projects/gnu.org/gcc/package.yml b/projects/gnu.org/gcc/package.yml index 5600b1b7d8..1bcbba3873 100644 --- a/projects/gnu.org/gcc/package.yml +++ b/projects/gnu.org/gcc/package.yml @@ -26,9 +26,25 @@ dependencies: gnu.org/mpfr: ">=2.4.0" gnu.org/mpc: ">=0.8.0" zlib.net: ^1.3 + linux: + gnu.org/glibc: "*" # libc headers (stdlib.h, stdio.h, ...) + + # crt*.o + libc.so.6 for from-source C/C++ + # builds in pkgx-isolated environments + kernel.org/linux-headers: "*" # Linux syscall headers for libc consumers darwin/x86-64: # since 15.1.0 libisl.sourceforge.io: ^0 +# Expose the bottle's libc headers + libraries via standard env vars +# so end-user invocations (`pkgx gcc test.c`) find stdlib.h, link +# against the bottled libc, and resolve crt*.o for C/C++ output — +# without needing distro `glibc-devel` / `libc6-dev` packages. +# See pkgxdev/pantry#8423. +runtime: + env: + linux: + CPATH: ${{deps.gnu.org/glibc.prefix}}/include${CPATH:+:$CPATH} + LIBRARY_PATH: ${{deps.gnu.org/glibc.prefix}}/lib${LIBRARY_PATH:+:$LIBRARY_PATH} + build: dependencies: linux: From c9bb69639eaf5b24279059b3c35eadf079c927a2 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 17:53:57 +0200 Subject: [PATCH 2/2] fix(gcc): drop runtime.env CPATH/LIBRARY_PATH override (broke own build) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #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 --- projects/gnu.org/gcc/package.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/projects/gnu.org/gcc/package.yml b/projects/gnu.org/gcc/package.yml index 1bcbba3873..7ba671bfb4 100644 --- a/projects/gnu.org/gcc/package.yml +++ b/projects/gnu.org/gcc/package.yml @@ -34,17 +34,6 @@ dependencies: darwin/x86-64: # since 15.1.0 libisl.sourceforge.io: ^0 -# Expose the bottle's libc headers + libraries via standard env vars -# so end-user invocations (`pkgx gcc test.c`) find stdlib.h, link -# against the bottled libc, and resolve crt*.o for C/C++ output — -# without needing distro `glibc-devel` / `libc6-dev` packages. -# See pkgxdev/pantry#8423. -runtime: - env: - linux: - CPATH: ${{deps.gnu.org/glibc.prefix}}/include${CPATH:+:$CPATH} - LIBRARY_PATH: ${{deps.gnu.org/glibc.prefix}}/lib${LIBRARY_PATH:+:$LIBRARY_PATH} - build: dependencies: linux: