From 88461e56eeb049bdbfaae699961f36f5c6210ee0 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 29 May 2026 17:02:34 +0200 Subject: [PATCH] fix(gnu.org/gcc): add Debian-style multi-arch triplet symlinks on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many Linux build systems (autoconf, distutils, setuptools, pip build backends, scikit-build, etc.) probe for the architecture-prefixed binary names — `x86_64-linux-gnu-gcc`, `aarch64-linux-gnu-g++`, etc. — before falling back to plain `gcc`. Without these symlinks, pip-install of any Python C-extension wheel fails on Ubuntu/Debian rootfs even when `gcc` IS on PATH. Addresses one of the two complaints in pkgxdev/pantry#8423. The other issue raised there (`stdlib.h: No such file or directory` on Fedora) is the libc-headers gap — pkgx's gcc relies on the system glibc-devel for /usr/include/stdlib.h etc. That requires a separate gnu.org/glibc bottle + runtime dep wiring; see bklibcvenv-pattern follow-ups (pkgxdev/pantry#12968 and brewkit#348). --- projects/gnu.org/gcc/package.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/projects/gnu.org/gcc/package.yml b/projects/gnu.org/gcc/package.yml index cd666b24a4..1426082b22 100644 --- a/projects/gnu.org/gcc/package.yml +++ b/projects/gnu.org/gcc/package.yml @@ -1,4 +1,3 @@ -distributable: url: https://ftp.gnu.org/gnu/gcc/gcc-{{version.raw}}/gcc-{{ version.raw }}.tar.xz strip-components: 1 @@ -76,6 +75,23 @@ build: ln -sf ../../../binutils/v\*/bin/ranlib ranlib working-directory: ${{prefix}}/bin + # Many Linux build systems (autoconf, distutils/setuptools, pip + # build backends) probe for the Debian-style multi-arch triplet + # binary names ($arch-linux-gnu-gcc, etc.) before falling back to + # plain `gcc`. Without these, pip-install of C-extension Python + # wheels fails on Ubuntu/Debian rootfs even when gcc IS on PATH. + # See pkgxdev/pantry#8423. + - run: | + case "{{hw.arch}}" in + x86-64) TRIPLET=x86_64-linux-gnu ;; + aarch64) TRIPLET=aarch64-linux-gnu ;; + esac + for tool in gcc g++ cpp c++ ar nm ranlib; do + [ -e "$tool" ] && ln -sf "$tool" "$TRIPLET-$tool" + done + if: linux + working-directory: ${{prefix}}/bin + # .la archives aren't relocatable - run: find . -name '*.la' -exec rm {} \; working-directory: ${{prefix}}/lib