-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
cmake: LLVM needs to link against zlib #8932
Conversation
Is this a static-linking-only dependency? (i.e. the dynamic LLVM library would already depend on libz?) |
Yes |
CMakeLists.txt
Outdated
@@ -713,11 +713,14 @@ set_target_properties(zigcpp PROPERTIES | |||
COMPILE_FLAGS ${EXE_CFLAGS} | |||
) | |||
|
|||
find_library(ZLIB NAMES libz.a z zlib libz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is libz.a
first? shouldn't the following z
find it anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this line from another place in the CMakeLists.txt
in order to quickly get this working to test the zig-bootstrap changes. This could probably be cleaned up (I'm no cmake expert) and should probably be put behind some ZIG_USE_ZLIB
flag which is automatically enabled if ZIG_STATIC
is true.
One thing to keep in mind here: if this forces linking of |
I just read ziglang/zig-bootstrap#58 and since we are building |
this is also presumably only a temporary measure until #8726 is complete edit: that issue was placed a lot farther out than i remembered |
For more details on why this dependency is needed, see ziglang/zig-bootstrap#57
I really don't understand how this is causing a segfault on freebsd while making aarch64-linux print "zig0: not found" |
🤷♂️ |
I'm guessing that we're incorrectly finding zlib on these systems but it's invalid for whatever reason and if we provide our own build it will work fine. Just need to update the CI tarballs to test this. |
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
I have no idea why drone CI is failing. It works fine with the bootstrap repository. |
$ file zig0
zig0: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 13.0 (1300139), FreeBSD-style, with debug_info, not stripped
$ ldd zig0
zig0:
zig0: signal 11
$ file zig0
zig0: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 13.0 (1300139), FreeBSD-style, with debug_info, not stripped
$ ldd zig0
ldd: zig0: not a dynamic ELF executable That first edit: it stands to reason that the |
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
FYI, I've updated macos tarballs to the latest zig-bootstrap, pushed them to our s3 instance and updated the CI scripts. Fingers crossed everything is going to work out fine! |
Thanks @kubkon! Based on @mikdusan's comment I expect FreeBSD to be fixed based solely on an updated tarball, which I will do today. And then it's just the Drone CI mystery left to solve. The nuclear option would be to stop trying to get alpine linux to build our tarballs, but instead only use it to test, and then use the bootstrap repository to provide the aarch64-linux tarballs. This is probably a good idea; arguably all the Zig tarballs we provide on the download page should be via zig-bootstrap. |
I definitely agree with the last bit: all the Zig tarballs we provide on the download page should be via zig-bootstrap. |
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
FreeBSD tarball is updated; let's see if it passes. I also created the aarch64-musl tarball ( |
bcc464d
to
98afc04
Compare
whew, I think this may finally be in a passing state. |
Without this, LLVM is crippled. This makes building Zig on Windows more
involved and is probably going to lead to more issues filed.
For more details see
ziglang/zig-bootstrap#57