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

'make check' fails on '08_nodeflib' #80

Open
artyom-poptsov opened this issue Jun 11, 2022 · 1 comment
Open

'make check' fails on '08_nodeflib' #80

artyom-poptsov opened this issue Jun 11, 2022 · 1 comment

Comments

@artyom-poptsov
Copy link
Contributor

Hello,

when I try to run tests, '08_nodeflib' fails:

/tmp/guix-build-libtree-3.1.1.drv-0/source/tests/08_nodeflib$ make check
echo 'int f(){return 1;}' | cc -z nodefaultlib -Wl,--no-as-needed -shared -Wl,-soname,lib_nodefaultlib.so -o lib_nodefaultlib.so -x c -
echo 'int g(){return 1;}' | cc -Wl,--no-as-needed -shared -Wl,-soname,lib_defaultlib.so -o lib_defaultlib.so -x c -
echo 'extern int f(); extern int g(); int main(){return f() + g();}' | cc -z nodefaultlib -o exe_a -Wl,--enable-new-dtags '-Wl,-rpath,$ORIGIN' -x c - -L. -l_nodefaultlib -l_defaultlib
echo 'extern int g(); int main(){return g();}' | cc -z nodefaultlib -o exe_b -Wl,--disable-new-dtags '-Wl,-rpath,$ORIGIN' -x c - -L. -l_defaultlib
! ../../libtree -vvv exe_a # should likely not find libc
exe_a 
├── lib_nodefaultlib.so [runpath]
│   └── libc.so.6 [runpath]
│       └── ld-linux-x86-64.so.2 [ld.so.conf]
├── lib_defaultlib.so [runpath]
│   └── libc.so.6 [runpath]
│       └── ld-linux-x86-64.so.2 [ld.so.conf]
└── libc.so.6 [runpath]
    └── ld-linux-x86-64.so.2 [ld.so.conf]
make: *** [Makefile:33: check] Error 1

As far as I can see, the issue is that libtree finds libc when it shouldn't. I'm using the following compiler and linker versions:

$ gcc --version
gcc (GCC) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ld --version
GNU ld (GNU Binutils) 2.37
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

The tests ran on Ubuntu 20.04.4 LTS

Thanks,
avp

@haampie
Copy link
Owner

haampie commented Jun 13, 2022

Seems like you're using Guix, which probably has a compiler spec or wrapper to add rpaths to their glibc?

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

No branches or pull requests

2 participants