-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Built-in linker in Linux #299
Comments
Just the idea: a configuration file ( |
Zig actually provides its own musl-based linker libraries for cross compilation. I think this must be the goal, since making a linker work like this is not adding any extra capabilities: cross compilation still breaks. |
What would pkgconf do? |
I checked |
No, don't mind what's there for now, I need to experiment a bit with getting the right arguments. lld will return. |
You can start looking at dev now: it should have what's necessary to cross compile to MSVC and MacOS. Using LLD also works fine. |
Yes, thank you, I've already tested it. |
It will all get cleaned up. |
|
Great, I'll fix that right away. |
Perhaps |
Unfortunately not. MacOS for example does not support static linking of libc |
Issue: the linking time in the |
How does this work now? Is it better? |
|
Do you know where libc is found for you? |
@data-man can you see what possible paths there are to crt1.o and crtbegin.o? The simpler the better. |
Sure: |
Please try the very latest version. |
Sorry, In my previous message I omitted wasm and mingw paths as irrelevant, but ...
|
Does this work now @data-man |
|
Oh wait, it's x86 and not x64? |
Ok so it accidentally grabs your wasm32 and mingw installs |
Also musl library can be located in |
It's really difficult to add a good heuristic. You can look at "find_linux_crt" and "find_linux_crtbegin" on how this is done. If we know that some particular variant of linux uses some fixed paths, then we could check for those first. |
Some time ago I proposed use libpkgconf. It's small dependency (~256K). Now c3c contains miniz's sources. Maybe make it optional, like mimalloc? |
Ok, a few things:
|
@data-man Can you test if |
I tried this (with musl libc in the same directory):
|
But you're not setting --linux-crt and --linux-crtbegin? |
NVM, sorry. |
Can you try without --nolibc and just pointing to --linux-crt and --linux-crtbegin? |
Package musl-dev has this:
|
Is this working now? |
I'm currently using this patch in my OS.
It's bad, but it works.
The text was updated successfully, but these errors were encountered: