Closed git-bruh closed 2 years ago
I thought we solved this issue when multilib support was added. Apparently not.
I thought we solved this issue when multilib support was added. Apparently not.
The exact commit didn't propagate to upstream KISS, it was fixed in a different way with dependency rework by dylan. Multilib still works fine tho
Is there a way to actually determine the full path of a linked shared library?
Is there a way to actually determine the full path of a linked shared library?
Running ldd seems to give the correct paths, not sure what's going wrong in KISS code
Okay, I see the issue now. The directory where you are building the package is not part of the rpath. So ldd
fails to locate the shared library. When the library can't be located in the rpath it fallsback to the zlib
installed on the system, that's how rpath works. Going to the package directory and adding it to the LD_LIBRARY_PATH
seems to resolve it. However, I'm not sure how reliable this solution is.
Ahh, that explains the firefox bug aswell. /usr/lib/firefox is originally present with nss inside of it, and firefox's rpath is set to that dir regardless of build config, so kiss detects that nss instead of the one in /usr/lib
http://blog.tremily.us/posts/rpath/
The relevant linker flags are -rpath and --enable-new-dtags. Without --enable-new-dtags, you'll just set the RPATH flag, which is probably not what you want. With --enable-new-dtags, you'll set both RPAH and RUNPATH to the same value. From ld(1):
The DT_RPATH entries are ignored if DT_RUNPATH entries exist.
so setting both is the same as just setting RUNPATH (except for tools like chrpath which are only designed to handle a single tag). You can use readelf to see if the tags were set:
Should the fix account for such cases?
Dynamic section at offset 0x2de0 contains 26 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [./Library rpath: [asdfaffqfewffsd].so]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000f (RPATH) Library rpath: [/tmp/test]
0x000000000000000c (INIT) 0x1000
0x000000000000000d (FINI) 0x1134
0x0000000000000019 (INIT_ARRAY) 0x3dd0
This part could probably benefit from being written in C
λ readelf -d /usr/bin/llvm-readelf
Dynamic section at offset 0x1c7ca0 contains 32 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libLLVM-14.so]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../lib]
$ORIGIN needs to be handled too
Description
KISS doesn't check the RPATH/RUNPATH of executables which leads it to falsely add some packages as dependencies. Eg, if
nss
is installed in/usr/lib
andfirefox
is installed in/usr/lib/firefox
with bundled nss/nspr, kiss will add a dependency onnss
for firefoxError message
Package
The issue is similar to https://github.com/kiss-community/kiss/issues/20
See https://github.com/kiss-community/repo/pull/86#issuecomment-1234069350
CC @illiliti @ioraff @cemkeylan