FS#62394 - [aarch64-linux-gnu-gcc] Unable to link using aarch64-linux-gnu-gcc from x86_64

Attached to Project: Community Packages
Opened by Edoardo Morandi (dodomorandi) - Friday, 19 April 2019, 07:47 GMT
Last edited by Eli Schwartz (eschwartz) - Friday, 19 April 2019, 17:54 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Eli Schwartz (eschwartz)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
It is not possible to use the aarch64 GCC cross-compiler from x86_64 in order to compile a simple C program. The problem causes the following error:

/usr/lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: cannot find /usr/aarch64-linux-gnu/lib/libc.so.6 inside /usr/aarch64-linux-gnu
/usr/lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: cannot find /usr/aarch64-linux-gnu/lib/libc_nonshared.a inside /usr/aarch64-linux-gnu
/usr/lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: cannot find /usr/lib/ld-linux-aarch64.so.1 inside /usr/aarch64-linux-gnu

It looks like the linker is trying to use an absolute path like a relative one, because the files actually exist.

Steps to reproduce:
Create a simple test.c file with the following content:

int main() {}

Compile the file with the following:

aarch64-linux-gnu-gcc test.c -o test
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Friday, 19 April 2019, 17:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  aarch64-linux-gnu-glibc 2.28-3 allows the link to work again.
Comment by Eli Schwartz (eschwartz) - Friday, 19 April 2019, 14:38 GMT
The issue is related to using sysroot, which results in looking for files relative to the default sysroot /usr/aarch64-linux-gnu

I'm trying to determine why the paths are being doubled, though. This wasn't an issue until  FS#61504 
Comment by Eli Schwartz (eschwartz) - Friday, 19 April 2019, 17:53 GMT
So libc.so is actually a loader script containing absolute paths, which are then manipulated by the sysroot. Should be fixed by aarch64-linux-gnu-glibc 2.28-3

Loading...