LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-21-2007, 08:25 PM   #1
fastTalker
LQ Newbie
 
Registered: Feb 2006
Location: USA
Distribution: Debian Etch, Debian Lenny, Ubuntu Feisty
Posts: 28

Rep: Reputation: 15
cross compiling libJudy


I am attempting to cross compile libJudy for the avr32 processor

i am using the following to configure the makefile:
Code:
./configure --host=avr32-linux --prefix=/usr/avr32-linux --build=i686-pc-linux-gnu
configure completes successfully, but when i attempt to make i get the following error:
Code:
# make
make  all-recursive
make[1]: Entering directory `/tmp/Judy-1.0.4'
Making all in src
make[2]: Entering directory `/tmp/Judy-1.0.4/src'
Making all in .
make[3]: Entering directory `/tmp/Judy-1.0.4/src'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/tmp/Judy-1.0.4/src'
Making all in JudyCommon
make[3]: Entering directory `/tmp/Judy-1.0.4/src/JudyCommon'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/Judy-1.0.4/src/JudyCommon'
Making all in JudyL
make[3]: Entering directory `/tmp/Judy-1.0.4/src/JudyL'
avr32-linux-gcc -I. -I.. -I../JudyCommon/  -DJUDYL   -UJU_64BIT -g -O2 -o JudyLTablesGen JudyLTablesGen.c; ./JudyLTablesGen 
/bin/sh: ./JudyLTablesGen: cannot execute binary file
make[3]: *** [JudyLTables.c] Error 126
make[3]: Leaving directory `/tmp/Judy-1.0.4/src/JudyL'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/Judy-1.0.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/Judy-1.0.4'
make: *** [all] Error 2
it is compiling JudyLTablesGen for the avr32 and then trying to execute it on the build system (i686). this obviously will not work and kind of defeats the point of cross compiling.

Is this a flaw in the makefile or am i running configure incorrectly?
 
Old 12-21-2007, 09:58 PM   #2
fastTalker
LQ Newbie
 
Registered: Feb 2006
Location: USA
Distribution: Debian Etch, Debian Lenny, Ubuntu Feisty
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fastTalker View Post
it is compiling JudyLTablesGen for the avr32 and then trying to execute it on the build system (i686). this obviously will not work and kind of defeats the point of cross compiling.

Is this a flaw in the makefile or am i running configure incorrectly?
it might be the makefile. JudyLTablesGen appears to only be generating other c files for compilation. (i think. i haven't looked too closely at it. it could be doing more.)

but anyway, i changed the following line in the makefile from:
Code:
$(CC) $(INCLUDES) $(AM_CFLAGS) -UJU_64BIT -g -O2 -o JudyLTablesGen JudyLTablesGen.c; ./JudyLTablesGen
to:
Code:
gcc $(INCLUDES) $(AM_CFLAGS) -UJU_64BIT -g -O2 -o JudyLTablesGen JudyLTablesGen.c; ./JudyLTablesGen
CC is set to the avr32 compiler (the host compiler), not the build compiler (i686).

I also changed the same thing in one of the other Makefiles that had the same problem with Judy1TablesGen.

make and make install completed successfully and the program that is using libJudy successfully linked against the library. unfortunately, i do not actually have the processor with me to test it on. So it may have only appeared to fix it. i will post when i found out for sure (in case someone else ever runs across this same problem.)
 
Old 12-22-2007, 10:58 PM   #3
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,539

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I have no experience with libJudy, much less ever heard of it, and my knowledge with cross-compiling is also not that proficient.

However, if you are trying to cross-compile source code to work on a difference architecture than your host's i686, then you will need the appropriate cross-compiler... and in your case, one for the avr32 processor.

It seems that you have this cross-compiler, therefore I think the issue you are having is with the Makefile. It should not attempt to run the cross-compiled application on your i686. It won't work.

If you compile with the host's gcc compiler, then the application will not run on the avr32.

Cross-compiling is a tricky "game", in which you need to ensure that you have the proper C (and if necessary C++) libraries for the target system, including header files.
 
Old 12-24-2007, 04:51 PM   #4
fastTalker
LQ Newbie
 
Registered: Feb 2006
Location: USA
Distribution: Debian Etch, Debian Lenny, Ubuntu Feisty
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks for the reply.

Quote:
Originally Posted by dwhitney67 View Post
It seems that you have this cross-compiler, therefore I think the issue you are having is with the Makefile. It should not attempt to run the cross-compiled application on your i686. It won't work.

If you compile with the host's gcc compiler, then the application will not run on the avr32.

Cross-compiling is a tricky "game", in which you need to ensure that you have the proper C (and if necessary C++) libraries for the target system, including header files.
I've cross-compiled the pcap library for the avr32 and compiled programs against it so I know the cross compiler works.

The more I looked at it the more it seemed that it is the Makefile.

I really wanted to insure that i am using the correct options with the configure script.

thanks.
 
  


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
Cross compiling Mike Davies Linux - Kernel 5 02-23-2018 12:30 PM
Cross Compiling dosnlinux Programming 5 03-01-2006 12:12 PM
cross compiling cerin Linux - Software 1 02-11-2006 11:47 PM
cross-compiling? jon_k Programming 3 12-09-2004 10:36 AM
cross compiling with g++ hornofsalvation Linux - Newbie 2 10-09-2004 11:29 PM

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

All times are GMT -5. The time now is 12:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration