-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
-Lsrc/libutil is too late in linker path, fails with a link error: download.cc:905: undefined reference to `nix::runProgram #3087
Comments
I worked it around by reordering local and global LDFLAGS: |
Otherwise previous -L flags could cause the linker to use globally installed versions of libraries instead of the ones that were just compiled. Fix NixOS#3087
Do you accept pull requests? Is there anyone I can assign as reviewer to #3154? The Arch Linux User Repository (https://aur.archlinux.org/packages/nix) linked to my commit, and I'm mildly worried about unintentionally hosting unmerged changes for them. |
Otherwise previous -L flags could cause the linker to use globally installed versions of libraries instead of the ones that were just compiled. Fix NixOS#3087
I marked this as stale due to inactivity. → More info |
The bug happens when I try to build
nix-2.3
on a system withnix-2.2.2
installed in system (with/usr/lib64/libnixstore.so
).Linker pulls in system
/usr/lib64/libnixstore.so
and fails as:Note, the problem here is
-L
parameter ordering:x86_64-pc-linux-gnu-g++ -std=c++17 -o .../libnixstore.so -shared -L/usr/lib64 ... -Lsrc/libutil -lnixutil
.libnixstore.so
is pulled from/usr/lib64
.Ideally linker flags should mention local paths first and then external ones.
The text was updated successfully, but these errors were encountered: