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

libunwind: Link against Julia zlib #57798

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

Zentrik
Copy link
Member

@Zentrik Zentrik commented Mar 17, 2025

As we don't add $(build_shlibdir) to the search path, currently unwind seems to link against the system zlib. As mentioned in libunwind/libunwind#653 and from configure --help the standard way to link against a library in a non standard location is to set the CPPFLAGS and LDFLAGS. Tested by building with nix and in the package_linux rootfs image where we don't install zlib (though the shared library happens to be in the search path, the headers aren't).

Fixes #55617.

As we don't add `$(build_shlibdir)` to the search path, currently unwind seems to link against the system zlib. As mentioned in libunwind/libunwind#653 and from `configure --help` the standard way to link against a library in a non standard location is to set the `CPPFLAGS` and `LDFLAGS`. Tested by building with nix and in the package_linux rootfs image where we don't install zlib (though the shared library happens to be in the search path, the headers aren't).

Fixes JuliaLang#55617.
@Zentrik Zentrik added building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries labels Mar 17, 2025
LIBUNWIND_CPPFLAGS :=
LIBUNWIND_CFLAGS := -U_FORTIFY_SOURCE $(fPIC) $(SANITIZE_OPTS)
LIBUNWIND_CPPFLAGS := -I$(build_includedir)
LIBUNWIND_LDFLAGS := -L$(build_shlibdir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, we don't need to pass -lz here? The library would be picked up automatically?

Copy link
Member Author

@Zentrik Zentrik Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, and the configure will error if it doesn't find zlib as we pass a flag enabling zlib support.

@giordano giordano merged commit 8efd4f4 into JuliaLang:master Mar 17, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libunwind build system not picking up LDFLAGS causing build failure on systems without zlib
2 participants