You are not logged in.
Hi
since yesterday i have this issue that i can't build C/C++ libraries anymore on my machine
when I run
gcc -shared -W -o libshared.so hello1.o hello2.o
it seems its a glibc issue or linker issue? these files /usr/lib/libc.so.6 and /usr/lib/ld-linux-x86-64.so.2 actually exist, its probably incompatible
/usr/local/bin/ld: /usr/lib/libc.so.6: unknown type [0x13] section `.relr.dyn'
/usr/local/bin/ld: skipping incompatible /usr/lib/libc.so.6 when searching for /usr/lib/libc.so.6
/usr/local/bin/ld: cannot find /usr/lib/libc.so.6
/usr/local/bin/ld: /usr/lib/libc.so.6: unknown type [0x13] section `.relr.dyn'
/usr/local/bin/ld: skipping incompatible /usr/lib/libc.so.6 when searching for /usr/lib/libc.so.6
/usr/local/bin/ld: /usr/lib/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
/usr/local/bin/ld: skipping incompatible /usr/lib/ld-linux-x86-64.so.2 when searching for /usr/lib/ld-linux-x86-64.so.2
/usr/local/bin/ld: cannot find /usr/lib/ld-linux-x86-64.so.2
/usr/local/bin/ld: /usr/lib/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
/usr/local/bin/ld: skipping incompatible /usr/lib/ld-linux-x86-64.so.2 when searching for /usr/lib/ld-linux-x86-64.so.2
collect2: error: ld returned 1 exit status
make: *** [Makefile:5: hello] Error 1
here is a small example to test it
https://gitlab.com/1Jo1/gcc-dynamic-library-example
does anyone have the same problem?
I couldn't reproduce this issue on a virtual machine/laptop
I noticed that usr/local/bin/ld version on my machine is GNU ld (GNU Binutils) 2.37.50 but on my virtual machine/laptop its GNU ld (GNU Binutils) 2.38 and both systems are up to date which is really weird, glibc version, gcc version and binutils version is the same
or is ld in a different package?
Last edited by 1Jo1 (2022-08-07 14:49:00)
Offline
why do you have `ld` in /usr/local/bin ?
Offline
why do you have `ld` in /usr/local/bin ?
oh yeah you right that was the issue, thank you so much
Offline
a821 wrote:why do you have `ld` in /usr/local/bin ?
oh yeah you right that was the issue, thank you so much
How exactly did you fix if? where should 'ld' be? I dont get whats the issue
Offline
I removed /usr/local/bin/ld as I noticed when I did 'which ld' it actually used /usr/local/bin/ld, however it should be /usr/bin/ld on Arch LInux
it seems to be that I build ld manuelly I dont know haha
Offline
I removed /usr/local/bin/ld as I noticed when I did 'which ld' it actually used /usr/local/bin/ld, however it should be /usr/bin/ld on Arch LInux
it seems to be that I build ld manuelly I dont know haha
Aha, all right thank you so much! i was kinda scared to remove it but its working now, thank you <3
Last edited by QuarterOfCinnamonStick (2022-12-21 20:33:57)
Offline