hedpe |
10-04-2012 11:56 AM |
compiler fails to link to library that exists, strace shows "no such file" though
I am trying to cross-compile something for Android, and to pose this as a general question... during the compile stage it tries to link to a library that it believes does not exist:
Code:
arm-eabi-gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
The file does in fact exist, and I am including that in my path:
Code:
-L/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/libexec/gcc/arm-eabi/4.6.x-google
Here, I can list the files in that directory:
Code:
$ ls -l /mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/libexec/gcc/arm-eabi/4.6.x-google
total 70053
-rwxr-xr-x 1 501 dialout 47040814 Oct 3 14:29 cc1
-rwxr-xr-x 1 501 dialout 50903764 Oct 3 14:29 cc1plus
-rwxr-xr-x 1 501 dialout 423914 Oct 3 14:29 collect2
drwxr-xr-x 1 501 dialout 204 Oct 3 14:29 install-tools
-rwxr-xr-x 1 501 dialout 1090 Oct 3 14:29 libfunction_reordering_plugin.la
lrwxr-xr-x 1 501 dialout 38 Oct 3 14:29 libfunction_reordering_plugin.so -> libfunction_reordering_plugin.so.0.0.0
lrwxr-xr-x 1 501 dialout 38 Oct 3 14:29 libfunction_reordering_plugin.so.0 -> libfunction_reordering_plugin.so.0.0.0
-rwxr-xr-x 1 501 dialout 89427 Oct 3 14:29 libfunction_reordering_plugin.so.0.0.0
-rwxr-xr-x 1 501 dialout 994 Oct 3 14:29 liblto_plugin.la
lrwxr-xr-x 1 501 dialout 22 Oct 3 14:29 liblto_plugin.so -> liblto_plugin.so.0.0.0
lrwxr-xr-x 1 501 dialout 22 Oct 3 14:29 liblto_plugin.so.0 -> liblto_plugin.so.0.0.0
-rwxr-xr-x 1 501 dialout 238575 Oct 3 14:29 liblto_plugin.so.0.0.0
-rwxr-xr-x 1 501 dialout 44647203 Oct 3 14:29 lto1
-rwxr-xr-x 1 501 dialout 114284 Oct 3 14:29 lto-wrapper
So what strace shows is:
Code:
access("/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../libexec/gcc/arm-eabi/4.6.x-google/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../libexec/gcc/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../lib/gcc/arm-eabi/4.6.x-google/../../../../arm-eabi/bin/arm-eabi/4.6.x-google/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../lib/gcc/arm-eabi/4.6.x-google/../../../../arm-eabi/bin/liblto_plugin.so", R_OK) = -1 ENOENT (No such file or directory)
However, that first path that it tries IS valid, however it is a link:
Code:
$ file /mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../libexec/gcc/arm-eabi/4.6.x-google/liblto_plugin.so
/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../libexec/gcc/arm-eabi/4.6.x-google/liblto_plugin.so: symbolic link to `liblto_plugin.so.0.0.0'
Does anyone know why this would fail if the file does in fact exist? That link is valid.
|