-
-
Notifications
You must be signed in to change notification settings - Fork 303
musl-based linux distro support #2577
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
base: master
Are you sure you want to change the base?
musl-based linux distro support #2577
Conversation
/lib/ld-musl-x86-64.so.1 is musl's ld so. My bad
|
Very interesting. I'll have a look later. |
|
Could we have some way to verify musl on CI? It would be great, because otherwise this could accidentally break without anyone noticing. |
|
Alright, I'll see if I can figure out how to set up tests for an Alpine or Void instance, since either one can run as a musl-based distro. Though, I don't believe either one has static libraries for lld in their repositories, so I'll have to figure out how to get them on the instance through other means. I've been currently using TinyGo's Makefile to fetch resources for static lld and llvm libs. |
Okay. I'll just have an Alpine test using the dynamic libraries for lld and llvm now, since that is what's ordinarily available. |
Forgot to have bundle_output job use `env.LLVM_RELEASE_VERSION_ALPINEv3_22`.
|
Sorry about all of that. Not used to writing or editing github workflows at all, so I apologize for any inconvenience. |
sudo doesn't exist in alpine by default, and runs in root by default.
`--linker=builtin` fails because it forces search of `/lib64/ld-linux-x86-64.so.2`. lib64 doesn't exist on musl unless created as a symlink, and the appropriate so is /lib/ld-musl-<arch>.so.1
make isn't in alpine by default. added it in for risc-v example.
|
No problem. We're almost there. But something seems to fail in that project building step. |
|
Yep. It is |
|
I'll be working on linker.c, target.c, enums.h, and a few other places related to target triples and linking to get it to look in the right places for everything. There are issues with other commands passed as well regarding musl, so I'll be working on it before work, when I get home tonight and tomorrow morning. |
Just a quick update and inquiry. I'm using rootfs tarballs of Alpine Linux, Debian and Void Linux (glibc and musl) to get a small sample size of ld locations for linux-gnu variants over linux-musl ones. surprisingly, looks like for all of them, be it glibc or musl-based, |
I just found the llvm-project's llvm-project/clang/test/Driver/linux-ld.c. This contains all of the paths for ld-linux, ld-musl, crt, distro-specific libs, etc used by clang. |
|
It would be awesome to incorporate all of those. |
Agreed. I'm scanning through all of the driver tests for clang to incorporate as much as I can into linker.c for builtin linking. Also trying to find out exactly when the compiler fetches environment information to ensure we have that when doing linking. Also, real quick, does anyone care for dietlibc or uClibc support? I already have a check for musl added to |
|
We can probably stick to musl & glibc for now. |
|
Sounds good. Keeps things simple. |
added a switch statement to linker.c to link to
/lib/ld-musl-x86-64.so.1if being compiled from source on a musl-based x86-64 linux distribution.