Skip to content

libunwind build system not picking up LDFLAGS causing build failure on systems without zlib #55617

Open

Description

LDFLAGS is required for the linker to find bundled libraries

julia/Make.inc

Line 728 in 378f192

LDFLAGS += -L$(build_libdir) -Wl,-rpath,$(build_libdir)

But libunwind build system is not passing it to the linker, causing configure/build failure on systems without zlib, for example the nixpkgs stdenv.

configure:3928: checking whether the C compiler works
configure:3950: gcc -m64   -U_FORTIFY_SOURCE -fPIC -lz     -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin -Wl,-rpath-link,/build/julia-1.10.5/usr/lib -Wl,--enable-new-dtags  conftest.c  >&5
/nix/store/x7yyxvwy1f9hlx72rzrgx069jyf7hxwr-binutils-2.42/bin/ld: cannot find -lz: No such file or directory

Additionally, in #42782, -lz was added to LIBUNWIND_CFLAGS in deps/unwind.mk:

LIBUNWIND_CFLAGS := -U_FORTIFY_SOURCE $(fPIC) -lz $(SANITIZE_OPTS)

But -lz is already handled by libunwind configure script:
https://github.com/libunwind/libunwind/blob/v1.5.0/configure.ac#L316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    buildingBuild system, or building Julia or its dependenciesexternal dependenciesInvolves LLVM, OpenBLAS, or other linked libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions