It appears clang is able to locate the gcc toolchain from triplet without distro name for aarch64, but not armv7:
Setup:
# aarch64 gcc toolchain
$ ls /crossrootfs/arm64/usr/lib/gcc
aarch64-alpine-linux-musl
# armv7 gcc toolchain
$ ls /crossrootfs/arm/usr/lib/gcc
armv7-alpine-linux-musleabihf
Test:
✅ aarch64-alpine-linux-musl
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm64" --target=aarch64-alpine-linux-musl
✅ aarch64-linux-musl
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm64" --target=aarch64-linux-musl
✅ armv7-alpine-linux-musleabihf
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm" --target=armv7-alpine-linux-musleabihf
❌ armv7-linux-musleabihf
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm" --target=armv7-linux-musleabihf
/usr/bin/ld: cannot find crtbeginS.o: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
clang-18: error: linker command failed with exit code 1 (use -v to see invocation)
Other musllibc-based distros use neutral names for gcc toolchain: ${arch}-linux-musl. Due to this disparity in identifying gcc toolchain, we would need to special case musleabihf for Alpine Linux.
It appears clang is able to locate the gcc toolchain from triplet without distro name for aarch64, but not armv7:
Setup:
```sh
# aarch64 gcc toolchain
$ ls /crossrootfs/arm64/usr/lib/gcc
aarch64-alpine-linux-musl
# armv7 gcc toolchain
$ ls /crossrootfs/arm/usr/lib/gcc
armv7-alpine-linux-musleabihf
```
Test:
```sh
✅ aarch64-alpine-linux-musl
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm64" --target=aarch64-alpine-linux-musl
✅ aarch64-linux-musl
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm64" --target=aarch64-linux-musl
✅ armv7-alpine-linux-musleabihf
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm" --target=armv7-alpine-linux-musleabihf
❌ armv7-linux-musleabihf
$ echo "int main(void) { }" | clang-18 -xc - --sysroot="/crossrootfs/arm" --target=armv7-linux-musleabihf
/usr/bin/ld: cannot find crtbeginS.o: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
/usr/bin/ld: cannot find -lgcc: No such file or directory
clang-18: error: linker command failed with exit code 1 (use -v to see invocation)
```
Other musllibc-based distros use neutral names for gcc toolchain: `${arch}-linux-musl`. Due to this disparity in identifying gcc toolchain, we would need to special case musleabihf for Alpine Linux.
It appears clang is able to locate the gcc toolchain from triplet without distro name for aarch64, but not armv7: Setup:
Test:
Other musllibc-based distros use neutral names for gcc toolchain:
${arch}-linux-musl
. Due to this disparity in identifying gcc toolchain, we would need to special case musleabihf for Alpine Linux.