From a04f41d061136b0ab66b7e1ebf1179f04357f1e9 Mon Sep 17 00:00:00 2001
From: linear cannon <dev@linear.network>
Date: Tue, 15 Aug 2023 17:42:38 -0400
Subject: [PATCH] main/gcc: add symlink for ${CTARGET}cc

bootstrap has been broken in alpine for several weeks due to a change
in the recipe for `main/musl` to use `${CROSS_COMPILE}cc` instead of
`${CROSS_COMPILE}gcc`. this works for compiling on the local machine,
but breaks during bootstrap because there is no matching symlink from
${CTARGET}-cc to ${CTARGET}-gcc. this adds that symlink, fixing bootstrap.
---
 main/gcc/APKBUILD | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index ab578f2c9a55..211093c23b20 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -12,7 +12,7 @@ _pkgsnap="${pkgver##*_git}"
 [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
 
 pkgname="$pkgname$_target"
-pkgrel=1
+pkgrel=2
 pkgdesc="The GNU Compiler Collection"
 url="https://gcc.gnu.org"
 arch="all"
@@ -410,6 +410,7 @@ package() {
 	make -j1 DESTDIR="$pkgdir" install
 
 	ln -s gcc "$pkgdir"/usr/bin/cc
+	ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
 
 	if $LANG_JIT; then
 		make -C "$_builddir"/libgccjit-build/gcc DESTDIR="$pkgdir" jit.install-common
-- 
GitLab