Compiling mednafen in a prefix eventually fails to link. Reproducible: Always Steps to Reproduce: Run "emerge mednafen" in prefixed environment. Actual Results: Link error. Expected Results: Successful build. I think this is the relevant part of the error: /home/deck/gentoo/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libpulsecommon-17.0.so, needed by /home/deck/gentoo/usr/lib64/libpulse.so.0, not found (try using -rpath or -rpath-link) Running ldd -d on libpulse.so.0 in the prefixed environment finds /home/deck/gentoo/usr/lib64/pulseaudio/libpulsecommon-17.0.so and reports no errors.
Created attachment 894895 [details] output of `emerge --info '=games-emulation/mednafen-1.32.1::gentoo'`
Created attachment 894896 [details] output of `emerge -pqv '=games-emulation/mednafen-1.32.1::gentoo'`
Created attachment 894897 [details] build log
Setting LD_LIBRARY_PATH to the directory containing libpulsecommon-17.0.so works around this.
mednafen does not use libpulse* at all, but it does link with libsdl2 that can be indirectly using it if USE=pulseaudio and could trigger a build failure. Not sure why, but it seems(?) to be either libpulse itself that's broken or something with the toolchain/prefix. Aka, forget mednafen, cannot link a simple program with libpulse: $ gcc -o test -x c $(pkgconf --cflags --libs libpulse) - <<<'int main(void) { return 0; }' /home/ionen/prefix/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libpulsecommon-17.0.so, needed by /home/ionen/prefix/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libpulse.so, not found (try using -rpath or -rpath-link) Not quite sure why it's happening at a glance, it *should* know where to find it: $ readelf -d /home/evan/prefix/usr/lib64/libpulse.so.0.24.3 | grep RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [/home/ionen/prefix/usr/lib64/pulseaudio] $ lddtree prefix/usr/lib64/libpulse.so | grep common libpulsecommon-17.0.so => /home/ionen/prefix/usr/lib64/pulseaudio/libpulsecommon-17.0.so (file does exist and seems valid) Guess I'll assign to libpulse+prefix for now (maybe someone else has an idea, I don't mess with prefix much), but not convinced that the issue is really libpulse. Either way I don't think it's mednafen.
I believe this is another instance of bug #913489, which happens on RAP prefix when a library in a non-standard directory is pulled in, e.g. /usr/lib/pulseaudio/libpulsecommon-17.0.so. It's a long-standing issue that is partly my fault in my efforts to fix other issues, but I just haven't had time to address it. One way around it is to any linker other than bfd. I recommend mold.