Fedora Linux Support Community & Resources Center
  #1  
Old 5th March 2015, 04:05 PM
bob p Offline
Registered User
 
Join Date: May 2010
Posts: 185
linuxfedorafirefox
Question bad ELF interpreter when cross-compiling

Problem:

Code:
-bash: /usr/bin/rm: /lib/ld-linux-armhf.so.3: bad ELF interpreter: No such file or directory
I'm running a 64-bit only deployment of F21 x86_64 on an AMD FX box.

I think I might have a toolchain problem when it comes to cross-compiling for ARM-6, but I'm not sure of the problem or how to fix it.

I'm trying to cross-compile a kernel and modules for an RPi using these instructions provided by CirrusLogic:

https://github.com/CirrusLogic/rpi-l...lding-the-code

The instructions on Github contain several trivial bash syntax errors. Ignoring them and proceeding with the compile, everything seems to work fine... that is there don't appear to be any major errors issued during the make.

My problem comes along when I port the new kernel and modules to the ARM-6 environment via SSH. Looking at Step 7 in the guide, the first indication of an error occurs on the last line of Step 7, where the tarball gets deleted. For some reason, the process of extracting the tarball seems to have killed the bash environment on the destination machine. The following error is issued:

Code:
# rm /tmp/modules.tgz
-bash: /usr/bin/rm: /lib/ld-linux-armhf.so.3: bad ELF interpreter: No such file or directory
My best guess at the problem is that the ELF errors could be related to attempting to cross-compile 32-bit ARM-6 code on a 64-bit-only system. The make proceeds without a problem, it's just that the code breaks the destination box when I port it over.

I'm assuming that this has to be related in some way to the fact that I have a 64-bit only F21 install, and that I need 32-bit libraries in my toolkit, but I'm not sure which files are needed.

Any help would be appreciated.
Reply With Quote
  #2  
Old 5th March 2015, 05:04 PM
Jean Pierre Offline
Registered User
 
Join Date: Feb 2011
Posts: 164
linuxfirefox
Re: bad ELF interpreter when cross-compiling

Quote:
Code:
# rm /tmp/modules.tgz
-bash: /usr/bin/rm: /lib/ld-linux-armhf.so.3: bad ELF interpreter: No such file or directory
My best guess at the problem is that the ELF errors could be related to attempting to cross-compile 32-bit ARM-6 code on a 64-bit-only system.
/lib/ld-linux-armhf.so.3 looks like being a 32-bit interpreter (otherwise it would be fetched from /lib64)
You probably have a mismatch between the interpreter version known to your build environment and the one installed on the target machine. Check whether you do have an interpreter on your target machine and if so check its version :
Code:
ls -l /lib/ld-linux*
Reply With Quote
  #3  
Old 5th March 2015, 05:21 PM
bob p Offline
Registered User
 
Join Date: May 2010
Posts: 185
linuxfedorafirefox
Re: bad ELF interpreter when cross-compiling

Thanks for your interest.

As I mentioned earlier, the bash shell on the RPi is broken, so I'm not able to issue commands directly from within the RPi working environment.
My only option is to pull the SD card that contains the OS and read it on another PC.

Doing that, I get the following output:

Code:
$ vdir /run/media/bob/rootfs/lib/ld-linux*
lrwxrwxrwx. 1 root root 10 Aug  1  2014 /run/media/bob/rootfs/lib/ld-linux-armhf.so.3 -> ld-2.18.so                                 
lrwxrwxrwx. 1 root root 24 Aug  1  2014 /run/media/bob/rootfs/lib/ld-linux.so.3 -> /lib/ld-linux-armhf.so.3
It looks like there's a broken symlink when I mount the card on an exernal linux box -- in the symlink on the second line, "/lib/ld-linux-arhmh.so.3" is flashing.
Presumably this is because the path changes when the SD card is no longer the root environment. Beyond that, I'm having trouble making sense of the symlinks.
Reply With Quote
Reply

Tags
bad, crosscompiling, elf, interpreter

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross compiling userspace applications for ARM john_erlandsson Programming & Packaging 2 7th January 2014 03:33 PM
cross compiling an appliction badabagni Installation, Upgrades and Live Media 1 12th September 2013 01:17 PM
Cross Compiling with Mock ImNtReal Using Fedora 0 18th September 2008 03:38 AM
Cross-compiling possible? Mat Using Fedora 1 6th July 2005 05:03 PM


Current GMT-time: 00:27 (Saturday, 27-05-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat