cross/crossdirect: translate cc to gcc (MR 1545)

Fix errors when trying to compile with "cc":
	ccache: error: Could not find compiler "aarch64-alpine-linux-musl-cc" in PATH
This commit is contained in:
Oliver Smith 2020-09-04 21:15:17 +02:00 committed by Bart Ribbers
parent a5ec53f157
commit caf226cd33
No known key found for this signature in database
GPG key ID: 699D16185DAFAE61
2 changed files with 7 additions and 2 deletions

View file

@ -17,7 +17,7 @@
pkgname=crossdirect pkgname=crossdirect
pkgver=4 pkgver=4
pkgrel=2 pkgrel=3
pkgdesc="Wrappers to launch native cross compilers in foreign chroots" pkgdesc="Wrappers to launch native cross compilers in foreign chroots"
url="https://postmarketOS.org" url="https://postmarketOS.org"
arch="all" arch="all"
@ -77,6 +77,6 @@ package() {
install -Dm755 "$srcdir/rustc-$_arch" "$_bindir/rustc" install -Dm755 "$srcdir/rustc-$_arch" "$_bindir/rustc"
done done
} }
sha512sums="53d2910a9079e1b8a7fef2992eb98ef9e1a70054fa9eb8a00e1c2f2d0b5b0de6fe8f2b8e8f7806396f76b0e97ccbf9169b36215b20f60792c6758f936681730a crossdirect.c sha512sums="500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
6be16ba88720e628a3ecc8fa53f8e7a21d2af268b0509745d989139874d6b94b640bfcff09575eaa19073810be6ef91169c1f83e94f5cf8e6819f2670d9408de rustc.sh 6be16ba88720e628a3ecc8fa53f8e7a21d2af268b0509745d989139874d6b94b640bfcff09575eaa19073810be6ef91169c1f83e94f5cf8e6819f2670d9408de rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh" ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh"

View file

@ -82,6 +82,11 @@ int main(int argc, char **argv)
} }
} }
// Translate "cc" to "gcc": /usr/bin/cc is a symlink to /usr/bin/gcc,
// but there is no <HOSTSPEC>-cc symlink (pmaports#732)
if (strcmp(executableName, "cc") == 0)
executableName = "gcc";
// prepend the HOSTSPEC to GCC binaries // prepend the HOSTSPEC to GCC binaries
if (isClang || startsWithHostSpec) { if (isClang || startsWithHostSpec) {
snprintf(newExecutable, sizeof(newExecutable), NATIVE_BIN_DIR "/%s", executableName); snprintf(newExecutable, sizeof(newExecutable), NATIVE_BIN_DIR "/%s", executableName);