Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-compilation assistance: Some architecture/target combinations use the GNU GCC binary instead of the MUSL one #724

Open
edmorley opened this issue Nov 9, 2023 · 1 comment
Labels
bug Something isn't working libcnb-package

Comments

@edmorley
Copy link
Member

edmorley commented Nov 9, 2023

In #577 support was added for Linux aarch64, however, the GCC binary name used was aarch64-linux-gnu-gcc rather than the MUSL variant (in this case aarch64-linux-musl-gcc) used by all of the other target/host combinations:

let gcc_binary_path = "aarch64-linux-gnu-gcc";

I believe this is an unintentional bug. (If instead there is a reason for it, it needs to have a comment added.)

@edmorley edmorley added bug Something isn't working libcnb-package labels Nov 9, 2023
@edmorley edmorley changed the title libcnb-package: Incorrect GCC binary used for target aarch64_unknown_linux_musl Cross-compilation assistence: Incorrect GCC binary used for target aarch64_unknown_linux_musl Nov 9, 2023
@edmorley
Copy link
Member Author

edmorley commented Nov 9, 2023

Checking an ARM64 Ubuntu 22.04 image with musl-tools installed, I see that aarch64-linux-musl-gcc does exist, and that it does differ from aarch64-linux-gnu-gcc - which confirms my belief that we should be using the former instead.

The gnu variant is simply a symlink to standard GCC:

root@5d2e9841af3b:/# ls -al /usr/bin/aarch64-linux-gnu-gcc
lrwxrwxrwx 1 root root 6 Aug  5  2021 /usr/bin/aarch64-linux-gnu-gcc -> gcc-11

Whereas the musl variant is this wrapper script:

root@5d2e9841af3b:/# cat /usr/bin/aarch64-linux-musl-gcc
#!/bin/sh
exec "${REALGCC:-aarch64-linux-gnu-gcc}" "$@" -specs "/usr/lib/aarch64-linux-musl/musl-gcc.specs"

@edmorley edmorley changed the title Cross-compilation assistence: Incorrect GCC binary used for target aarch64_unknown_linux_musl Cross-compilation assistence: Incorrect GCC binary used on Linux for target aarch64_unknown_linux_musl Nov 9, 2023
@edmorley edmorley changed the title Cross-compilation assistence: Incorrect GCC binary used on Linux for target aarch64_unknown_linux_musl Cross-compilation assistance: Incorrect GCC binary used on Linux for target aarch64_unknown_linux_musl Nov 9, 2023
@edmorley edmorley changed the title Cross-compilation assistance: Incorrect GCC binary used on Linux for target aarch64_unknown_linux_musl Cross-compilation assistance: Some architecture/target combinations use the GNU GCC binary instead of the MUSL one Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libcnb-package
Projects
None yet
Development

No branches or pull requests

1 participant