diff --git a/projects/gnu.org/gcc/package.yml b/projects/gnu.org/gcc/package.yml index 5600b1b7d8..6cec370b77 100644 --- a/projects/gnu.org/gcc/package.yml +++ b/projects/gnu.org/gcc/package.yml @@ -164,6 +164,23 @@ build: if: darwin/x86-64 working-directory: ${{prefix}}/lib + # 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 + env: # Branch from the Darwin maintainer of GCC, with a few generic fixes and # Apple Silicon support, located at https://github.com/iains/gcc-12-branch