AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

incompatible ld #119

Closed gantsevdenis closed 1 year ago

gantsevdenis commented 1 year ago

Sorry this is me first time trying Ada, and I have hard time getting it working. I thought maybe my gprbuild is too old, but trying to compile master gives me the same error as for any other project, even hello world:

/home/denis/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /lib64/libc.so.6: unknown type [0x13] section `.relr.dyn'
/home/denis/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6
/home/denis/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find /lib64/libc.so.6
/home/denis/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
/home/denis/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2
/home/denis/GNAT/2021/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find /lib64/ld-linux-x86-64.so.2

denis@dgecko:~/sources/ada_simple> uname -a
Linux dgecko 5.18.11-1-default #1 SMP PREEMPT_DYNAMIC Fri Jul 15 05:36:11 UTC 2022 (4fcb983) x86_64 x86_64 x86_64 GNU/Linux

denis@dgecko:~/sources/ada_simple> gprbuild --version
GPRBUILD Community 2021 (20210519) (x86_64-pc-linux-gnu)

denis@dgecko:~/sources/ada_simple> gnatls --version
GNATLS Community 2021 (20210519-103)

denis@dgecko:~/sources/ada_simple> gnatmake --version
GNATMAKE Community 2021 (20210519-103)

denis@dgecko:~/sources/ada_simple> strings  /lib64/libc.so.6 | grep version
...
GNU C Library (GNU libc) stable release version 2.36 (git c804cd1c00).

denis@dgecko:~/sources/ada_simple> file /lib64/ld-linux-x86-64.so.2 
/lib64/ld-linux-x86-64.so.2: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), static-pie linked, BuildID[sha1]=38764db6e54b75b0b7046cddf3536c594729a9de, not stripped

denis@dgecko:~/sources/ada_simple> /lib64/ld-linux-x86-64.so.2 --version
ld.so (GNU libc) stable release version 2.36.

denis@dgecko:~/GNAT-2/2021/libexec> gcc/x86_64-pc-linux-gnu/10.3.1/ld --version
GNU ld (GNU Binutils) 2.33.50.20191118

EDIT: using my system's linker instead of the bundled one solved the issue.