LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-04-2012, 12:56 PM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Rep: Reputation: 30
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.
 
Old 10-04-2012, 01:16 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,245

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Does directory "/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin" exists?
 
Old 10-04-2012, 01:18 PM   #3
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by eSelix View Post
Does directory "/mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin" exists?
It does:

Code:
$ ls -l /mnt/hgfs/Documents/thesis/android-wmon/core/os/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin
total 10767
-rwxr-xr-x 1 501 dialout  626840 Oct  3 14:29 arm-eabi-addr2line
-rwxr-xr-x 1 501 dialout  655232 Oct  3 14:29 arm-eabi-ar
-rwxr-xr-x 1 501 dialout 1198816 Oct  3 14:29 arm-eabi-as
-rwxr-xr-x 1 501 dialout  332792 Oct  3 14:29 arm-eabi-c++
-rwxr-xr-x 1 501 dialout  622296 Oct  3 14:29 arm-eabi-c++filt
-rwxr-xr-x 1 501 dialout  328696 Oct  3 14:29 arm-eabi-cpp
-rwxr-xr-x 1 501 dialout   27456 Oct  3 14:29 arm-eabi-elfedit
-rwxr-xr-x 1 501 dialout  332792 Oct  3 14:29 arm-eabi-g++
-rwxr-xr-x 1 501 dialout  328696 Oct  3 14:29 arm-eabi-gcc
-rwxr-xr-x 1 501 dialout  328696 Oct  3 14:29 arm-eabi-gcc-4.6.x-google
-rwxr-xr-x 1 501 dialout  105088 Oct  3 14:29 arm-eabi-gcov
-rwxr-xr-x 1 501 dialout 4122744 Oct  3 14:29 arm-eabi-gdb
-rwxr-xr-x 1 501 dialout 4122744 Oct  3 14:29 arm-eabi-gdbtui
-rwxr-xr-x 1 501 dialout  693624 Oct  3 14:29 arm-eabi-gprof
-rwxr-xr-x 1 501 dialout  942848 Oct  3 14:29 arm-eabi-ld
-rwxr-xr-x 1 501 dialout  942848 Oct  3 14:29 arm-eabi-ld.bfd
-rwxr-xr-x 1 501 dialout  635672 Oct  3 14:29 arm-eabi-nm
-rwxr-xr-x 1 501 dialout  806296 Oct  3 14:29 arm-eabi-objcopy
-rwxr-xr-x 1 501 dialout  989784 Oct  3 14:29 arm-eabi-objdump
-rwxr-xr-x 1 501 dialout  655232 Oct  3 14:29 arm-eabi-ranlib
-rwxr-xr-x 1 501 dialout  326904 Oct  3 14:29 arm-eabi-readelf
-rwxr-xr-x 1 501 dialout  854968 Oct  3 14:29 arm-eabi-run
-rwxr-xr-x 1 501 dialout  626744 Oct  3 14:29 arm-eabi-size
-rwxr-xr-x 1 501 dialout  626744 Oct  3 14:29 arm-eabi-strings
-rwxr-xr-x 1 501 dialout  806296 Oct  3 14:29 arm-eabi-strip
Interestingly, if I go in to the directory containing the shared library and remove the link from liblto_plugin.so to liblto_plugin.so.0.0.0 and then "cp liblto_plugin.so.0.0.0 liblto_plugin.so" then it links properly and my program compiles. Why is it broken when this file is a link? (sorry, using "link" to refer to two different things here).
 
Old 10-04-2012, 01:59 PM   #4
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 640

Rep: Reputation: 375Reputation: 375Reputation: 375Reputation: 375
Hi.

From man access:
Quote:
NOTES:
.....
access() may not work correctly on NFS file systems with UID mapping enabled, because UID mapping is
done on the server and hidden from the client, which checks permissions.
May this be a bug/incompatibility in HGFS similar to the one in NFS?
 
Old 10-04-2012, 02:30 PM   #5
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by firstfire View Post
Hi.

From man access:


May this be a bug/incompatibility in HGFS similar to the one in NFS?

hmmm maybe it is, thanks for pointing this out! I might pull my repository off of HGFS and see how it goes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"File exists" error in Chapter 6.2 (Preparing Virtual Kernel File System) antwoord Linux From Scratch 1 06-24-2012 03:59 AM
[SOLVED] Php question about checking if a input="file" file exists errigour Programming 4 12-11-2011 06:58 PM
[SOLVED] "start: Unknown job" but file exists mahmoodn Ubuntu 4 05-12-2011 11:00 AM
Evolution "Copy Link Location" fails Skaperen Linux - Software 0 12-20-2010 01:39 PM
make error "libtool: link: cannot find the library `' " jdolluc Linux - Software 2 10-15-2003 10:51 PM


All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration