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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
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?

@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.

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.

None yet

2 participants