* Tom Callaway:
One of my packages failed the mass rebuild, but only on ppc64le and
aarch64. The error they both hit is this:
Error: package or namespace load failed for 'BiocParallel' in
dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
'/builddir/build/BUILDROOT/R-BiocParallel-1.16.5-1.fc30.ppc64le/usr/lib64/R/library/BiocParallel/libs/BiocParallel.so':
/builddir/build/BUILDROOT/R-BiocParallel-1.16.5-1.fc30.ppc64le/usr/lib64/R/library/BiocParallel/libs/BiocParallel.so:
undefined symbol: shm_open
Error: loading failed
Is this an error message from the R interpreter?
On x86-64, the R interpreter already loads librt:
7f0f2635a000-7f0f2635c000 r--p 00000000 fd:01 402963247
/usr/lib64/librt-2.29.so
7f0f2635c000-7f0f26360000 r-xp 00002000 fd:01 402963247
/usr/lib64/librt-2.29.so
7f0f26360000-7f0f26362000 r--p 00006000 fd:01 402963247
/usr/lib64/librt-2.29.so
7f0f26362000-7f0f26363000 r--p 00007000 fd:01 402963247
/usr/lib64/librt-2.29.so
7f0f26363000-7f0f26364000 rw-p 00008000 fd:01 402963247
/usr/lib64/librt-2.29.so
That's because libR loads it:
$ readelf -d /usr/lib64/R/lib/libR.so
…
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
…
The way dynamic linking works is that it searches for symbols in the
caller's namespace, and not just what's referenced by DT_NEEDED.
Here's the linker invocation:
g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro
-Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-o BiocParallel.so ipcmutex.o -L/usr/lib64/R/lib -lR
Now, google says this might be due to a lack of -lrt, but what's not
clear to me is why it only fails on these two architectures (I've
confirmed that none of the others have -lrt either).
In general, underlinking can be very problematic because it causes the
base symbol version to be used at run time, even if your program
actually requires a newer symbol version (for example, due to the
headers used at build time). Here it does not matter (today) because we
only have one symbol version for shm_open. But you do get interesting
effects with timer_create.
Thanks,
Florian