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

std.zig.NativeTargetInfo.abiAndDynamicLinkerFromFile: return an error when the file is not actually dynamic #17123

Closed
wants to merge 1 commit into from

Conversation

git-bruh
Copy link

partly addresses #14577

One more thing needs to be solved -- on my glibc system with a statically linked env, the default ABI is set to musl:

testuser@shed zig $ zig build-exe --show-builtin | grep musl
pub const abi = std.Target.Abi.musl;

Now, passing -DZIG_TARGET_TRIPLE explicitly at compile time should resolve this (for local builds ofc, official zig releases would still have this issue), but then linking with shared LLVM breaks as the CMake code assumes that if ZIG_TARGET_TRIPLE is explicitly specified, we must be cross compiling and linking static LLVM libs for simplicity.. Any hints wrt solving this in a sane manner?

@git-bruh
Copy link
Author

Hm, one idea that comes to mind is that if target is native, we can go through the list of all candidate interpreters and just use the first one that exists, eg. if we have /lib/ld-linux-x86-64.so.2 and /lib/ld-musl-x86_64.so.1, zig can just use which ever one exists

This is the only portable thing that comes to mind other than parsing ldd output, which would be a bit too much of special casing

@git-bruh
Copy link
Author

I think this change by itself is ready for review, the logic for handling the above mentioned case can be discussed and implemented in another PR

@git-bruh git-bruh marked this pull request as ready for review September 20, 2023 05:20
@git-bruh
Copy link
Author

@ifreund Hey, how can I push this PR forward?

@andrewrk
Copy link
Member

andrewrk commented May 9, 2024

I'm sorry, I didn't review this in time, and now it has bitrotted. Furthermore, so many pull requests have stacked up that I can't keep up and I am therefore declaring Pull Request Bankruptcy and closing old PRs that now have conflicts with master branch.

If you want to reroll, you are by all means welcome to revisit this changeset with respect to the current state of master branch, and there's a decent chance your patch will be reviewed the second time around.

Either way, I'm closing this now, otherwise the PR queue will continue to grow indefinitely.

@andrewrk andrewrk closed this May 9, 2024
@git-bruh
Copy link
Author

#19928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants