Skip to content

abiAndDynamicLinkerFromFile: return an error when the file is not actually dynamic #19928

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

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

git-bruh
Copy link
Contributor

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?

@BratishkaErik
Copy link
Contributor

BratishkaErik commented May 10, 2024

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?

If you refer to this "else" branch in "cmake/Findllvm.cmake", you can just pass "-DZIG_USE_LLVM_CONFIG=ON" explicitly.

if(ZIG_USE_LLVM_CONFIG)

zig/cmake/Findllvm.cmake

Lines 178 to 180 in fe1b397

else()
# Here we assume that we're cross compiling with Zig, of course. No reason
# to support more complicated setups.

@alexrp alexrp enabled auto-merge (squash) March 26, 2025 11:57
@alexrp alexrp added this to the 0.14.1 milestone Mar 26, 2025
@alexrp alexrp merged commit 5bb9963 into ziglang:master Mar 26, 2025
9 checks passed
@alexrp alexrp removed this from the 0.14.1 milestone Mar 26, 2025
@git-bruh git-bruh deleted the fix-interp branch May 1, 2025 14:25
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.

3 participants