JEDI/SOCA building ld: skipping incompatible /lib/libc.so.6

Deng-shun Chen
1 min readJan 27, 2021

--

check /lib/libc.so.6 is 32 or 64-bit

$>file /lib/libc.so.6
/lib/libc.so.6: symbolic link to `libc-2.17.so’

actually it is a symbolic link, go check /lib/libc-2.17.so

$> file /lib/libc-2.17.so
/lib/libc-2.17.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked (uses shared libs), BuildID[sha1]=adc9b8e8ad2b733119778615d8e4183df513cda3, for GNU/Linux 2.6.32, not stripped

/lib/libc.so.6 is a 32-bit LSB. Finding 64-bit library here in /lib64

$> file /lib64/libc-2.17.so
/lib64/libc-2.17.so: ELF 64-bit LSB shared object, x86–64, version 1 (GNU/Linux), dynamically linked (uses shared libs), BuildID[sha1]=4ec510505f71aeacdf5a4035bec5b39afbb65538, for GNU/Linux 2.6.32, not stripped

/home/xb80/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib

libc.so

change

GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-x86–64.so.2 ) )

to

GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86–64.so.2 ) )

libpthread.so

/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf64-x86–64)
GROUP ( /lib64/libpthread.so.0 /usr/lib64/libpthread_nonshared.a )

--

--