LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-22-2009, 03:53 PM   #1
kimjao
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
/usr/lib/libgd.so: file not recognized: File format not recognized


Hi all,

I'm trying to cross-compile glibc 2.2.3 for PowerPC 405 using ELDK 3.0 on a x86_64 machine. I have unzipped glibc-2.2.3 in a temp directory and configured using:
CC=ppc_4xx-gcc AR=ppc_4xx-ar RANLILB=ppc_4xx-ranlib ./configure ppc-linux --target=ppc-linux --host=ppc-linux --prefix=/usr/local/eldk3.0/ppc_4xx/ --enable-add-ons=../linuxthreads/ --with-headers=/home/kim/kernel-sw-003996-01/include/ --with-gd=/usr

The configuration seems to run fine but when I do make I get the following error:
make[1]: Leaving directory `/home/kim/Desktop/temp/glibc-2.2.3/csu'
make: *** [csu/subdir_lib] Error 2

This is the error in the config.log file:
configure:3341: ppc_4xx-gcc -o conftest -I/usr/include -L/usr/lib conftest.c -lgd -lpng -lz -lm 1>&5
/usr/lib/libgd.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
configure: failed program was:
#line 3334 "configure"
#include "confdefs.h"
#include <gd.h>
int main() {
gdImagePng (0, 0)
; return 0; }
configure:3361: checking size of long double
configure:16: checking installed Linux kernel header files
configure:209: checking for symlinks in /usr/local/eldk3.0/ppc_4xx//include
configure:3492: checking stdio selection
configure:3506: checking for old glibc 2.0.x headers
configure:3561: checking whether -fPIC is default

I have installed the libgd package using
apt-get install libgd2-xpm-dev
and I also tried recompiling using libgd2-noxpm-dev package
but I still get the same error.

Anyone know what's wrong? Any suggestions are welcome

Thanks in advance,
Kim
 
Old 07-22-2009, 04:57 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,484

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
The required library gd > > libgd.so must be cross
compiled for the target architecture.

Should be configured --prefix to some location,
not included in the LD_LIBRARY_PATH and afterwards
pointed to with e.g. 'export LD_LIBRARY_PATH=<newpath>'
.....

Linking against any library on the host is either
impossible or will make the result unusable.
So generally all dependencies must cross compiled.
( lpng = libpng.so too ).
.....

Last edited by knudfl; 07-22-2009 at 05:03 PM.
 
Old 07-24-2009, 11:46 AM   #3
kimjao
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Hi,

Thanks for your reply. This is what I did.. I copied the libgd.so file into a temp directory.

root@kim-desktop:/home/kim/Desktop/temp# ppc-linux-gcc ARCH=powerpc CROSS_COMPILE=ppc_4xx- GCC=ppc_4xx-gcc CC=ppc-linux-cc --prefix=/usr/local/eldk3.0/ppc_4xx/lib/ libgd.so
ppc-linux-gcc: CROSS_COMPILE variable is not set or invalid

ppc-linux-gcc is inside /usr/local/eldk3.0/usr/bin

root@kim-desktop:/home/kim/Desktop/temp# echo $PATH
/usr/local/eldk3.0/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Can you please tell me what I'm doing wrong?

Thanks
Kim
 
  


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
not in executable format: File format not recognized ypy13 Linux - Newbie 9 07-09-2008 11:33 PM
gdb "not in executable format: File format not recognized" tcma Programming 9 07-18-2007 06:02 AM
Fedora 7 64bit /usr/lib/libexpat.so: could not read symbols: File in wrong format GATTACA Fedora 1 06-21-2007 07:47 PM
/usr/lib/libfontconfig.so: could not read symbols: File in wrong format TrekJunky Linux - Newbie 2 10-01-2006 06:05 PM
File Format not recognized eachow Linux - Hardware 2 07-10-2006 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:33 AM.

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
Open Source Consulting | Domain Registration