Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#9959 closed defect (worksforme)

openwrt libgcc "ELF file data encoding not little-endian" on Fedora 15

Reported by: Harrie.Rooijackers+openwrt@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Backfire 10.03.1 RC5
Keywords: Cc:

Description

When building Openwrt on Fedora 15 for ar71xx a "ELF file data encoding not little-endian" error occurs when make runs a sh in building ulibC. This is due to the fact that on Fedora the sh command tries to load libgcc, however, the make process fills LD_LIBRARY_PATH with the path to the target code. As a result the host sh tries to load the target libgcc which has a different format.
Setting LD_LIBRARY_PATH to /lib upfront does not solve the problem as the make process adds the target paths to the front of LD_LIBRARY_PATH.

A quick and dirty workaround seems to be to run make as follows:

HOST_LIB_PATH_bfd=/lib: make

HOST_LIB_PATH_bfd is one of the environment variables used by the Makefile for ulibC that end up in the front of LD_LIBRARY_PATH and as a result make sh pick up the correct library.
Building an image now seems to work, not tested yet.
I have no idea whether this trick corrupts something else.

Attachments (0)

Change History (6)

comment:1 Changed 6 years ago by Harrie.Rooijackers+openwrt@…

Come to think of it it seems a bit odd that the Makefile sets LD_LIBRARY_PATH to target directories for building the target files since only host tools are used.

comment:2 Changed 6 years ago by Harrie.Rooijackers+openwrt@…

Similar problem when building for x86. Now the settings for LD_LIBRARY_PATH prohibit the host sh to load libc.so.0, it obviously is not present in the target tree specified by LD_LIBRARY_PATH (both host and target now have the same architecture).
The same workaround can be used to resolve the problem.

comment:3 Changed 6 years ago by jow

  • Resolution set to worksforme
  • Status changed from new to closed

I had no trouble building the entire Backfire release on CentOS 5.6, therfore I believe its an environment issue.

comment:4 Changed 6 years ago by mohnkhan

this problem exists in fedora 16 too :(

[mohnkhan@localhost backfire]$uname -a
Linux localhost.localdomain 3.2.7-1.fc16.i686 #1 SMP Tue Feb 21 01:38:57 UTC 2012 i686 i686 i386 GNU/Linux

[mohnkhan@localhost backfire]$ svn info
Path: .
URL: svn://svn.openwrt.org/openwrt/branches/backfire
Repository Root: svn://svn.openwrt.org/openwrt
Repository UUID: 3c298f89-4303-0410-b956-a3cf2f4a3e73
Revision: 30788
Node Kind: directory
Schedule: normal
Last Changed Author: hauke
Last Changed Rev: 30752
Last Changed Date: 2012-02-29 01:51:48 +0530 (Wed, 29 Feb 2012)

comment:5 Changed 6 years ago by mohnkhan

This looks related, had to add it here for quick reference though..
gcc.gnu.org/bugzilla/show_bug.cgi?id=41818

This cross compiler error is caused by changing LD_LIBRARY_PATH environment variable in Makefile

comment:6 Changed 4 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.