Author Topic: Cross-Compile Basic Path Problem...help!!!  (Read 6101 times)

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« on: March 16, 2004, 02:44:00 pm »
I\'m trying to cross-compile just the basic Qtopia example.  I followed the instructions for \"Red Hat 9\" and am able to get the qvfb x86 version working, but when I source the dev-arm-qpe.sh script, I can\'t do anything.

I try to build the Makefile using \"tmake -o Makefile example.pro\"
and get the message:

/usr/bin/perl: error while loading shared libraries: /opt/Qtopia/sharp/lib/libc.so.6: ELF file OS ABI invalid

Even just doing an \"ls\" I get errors!

ls: error while loading shared libraries: /opt/Qtopia/sharp/lib/libc.so.6: ELF file OS ABI invalid

I\'m sure it is a path problem, when I run the dev-x86-qpe.sh script, everything works just fine and my paths look like:

echo $LD_LIBRARY_PATH
/opt/Qtopia/lib:/usr/local/lib:/home/mcdoc/lib:

echo $PATH
/opt/Qtopia/bin:/opt/Qtopia/bin:/home/mcdoc/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/java/j2re1.4.2_02/bin:.:/opt/Embedix/tools/arm-linux/bin

When I run the dev-arm-qpe.sh script my paths look like:

echo $LD_LIBRARY_PATH
/opt/Qtopia/sharp/lib:/usr/local/lib:/home/mcdoc/lib:

echo $PATH
/opt/Qtopia/sharp/bin:/opt/Qtopia/sharp/bin:/opt/Embedix/tools/arm-linux/bin:/home/mcdoc/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/java/j2re1.4.2_02/bin:.

Am I seriously overlooking something???

Can anyone clue me in???

Thanks,
Doc
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

BlackCardinal

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • http://www.gelhaus.net
Cross-Compile Basic Path Problem...help!!!
« Reply #1 on: March 16, 2004, 03:00:50 pm »
It sounds to me like your linker is only using the $LD_LIBRARY_PATH variable to find libraries, and the dev-arm script is overwriting this variable with a value that doesn\'t include your ordinary library directories.  Try running this as root (without having run any of the dev- scripts):

# /sbin/ldconfig -v

This will update /etc/ld.so.conf so the linker knows where your libraries are.  This only needs to be done when you install any new libraries.  Then $LD_LIBRARY_PATH just adds additional directories for the linker in specific situations.
BlackCardinal : http://www.gelhaus.net : Zaurus page

SL-C1000, Cacko ROM v1.23
Lexar SD 512MB, Kingston CF 512MB
Symbol Spectrum24 CF 802.11b

SL-5500 Sharp ROM v3.10
Lexar SD 256MB
Pocketop keyboard, Nutshell 207 leather case

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #2 on: March 16, 2004, 03:04:43 pm »
That didn\'t seem to work, but it sounds like that is a starting point to look.
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

markb

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #3 on: March 16, 2004, 03:17:23 pm »
Hi Doc,

You\'re not the 1st to have this problem.
Welcome to the club. :-)

There\'s a discussion here that should help you out:
http://www.zaurususergroup.com/index.php?n...viewtopic&t=431

In a nutshell, the dev-arm-qpe.sh script has a bug in it.
It sets LD_LIBRARY_PATH incorrectly, which then stops you from running commands in the shell.

It shouldn\'t change LD_LIBRARY_PATH at all, so you could just comment out that line from the dev-arm-qpe.sh script.

- Mark

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Cross-Compile Basic Path Problem...help!!!
« Reply #4 on: March 16, 2004, 05:17:59 pm »
Hear hear to markb\'s post.

Where are people getting this file from? Someone should change it or inform whoever is hosting the file that it needs correction.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

markb

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #5 on: March 16, 2004, 05:47:15 pm »
I can\'t remember where I got my setup scripts from.
But it could have been from this website.
I just checked, and the script you get from the developer how-to is broken. :-(

See this page:
http://www.zaurususergroup.com/modules.php...ompiler%20Setup

The link to the script is a bit hard to spot.
See this line in section 2 (the file names are links):

Quote
Batch file #1, dev-x86-qpe.sh Batch file #2, dev-arm-qpe.sh

The problem with the script has been mentioned before.
I\'m not sure who we speak to to get it fixed.
(I guess I was lazy and just hoped a moderator would pick up on it and be able to sort it out).

I have just submitted a file to the download area, with a request that it replaces the current version.

- Mark

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #6 on: March 16, 2004, 06:33:22 pm »
I\'ll try it asap, and post again tomorrow.  

I was on the right track, and would have figured it out sooner or later,
I was just going to try commenting out various differences in the arm vs. the x86 script and once I got a compile send it on down and try the executable.  

This will definitely save time.

Doc
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #7 on: March 17, 2004, 08:25:40 am »
Ok, no go still.  The script may be wrong but here is what I found...

If I comment out LD_LIBRARY_PATH in the dev-x86-qpe.sh script, it will compile but when I try to run it using ./example -qws it doesn\'t work...so I put it back in.

If I comment out LD_LIBRARY_PATH in the dev-arm-qpe.sh script, it still gets link errors, but different ones...

arm-linux-gcc  -o example main.o example.o examplebase.o moc_example.o moc_examp lebase.o  -L/opt/Qtopia/sharp/lib -L/opt/Qtopia/sharp/lib -lqpe -lqtopia -lqte
/opt/Embedix/tools/arm-linux/bin/ld: warning: libuuid.so.1, needed by /opt/Qtopi a/sharp/lib/libqtopia.so, not found (try using -rpath or -rpath-link)
/opt/Embedix/tools/arm-linux/bin/ld: warning: libjpeg.so.62, needed by /opt/Qtop ia/sharp/lib/libqte.so, not found (try using -rpath or -rpath-link)
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_read_scanlines\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_set_defaults\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_start_decompress\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_destroy_decompress \'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_std_error\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_CreateDecompress\'
/opt/Qtopia/sharp/lib/libqtopia.so: undefined reference to `uuid_generate\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_read_header\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_start_compress\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_destroy_compress\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_finish_decompress\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_resync_to_restart\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_CreateCompress\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_finish_compress\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_set_quality\'
/opt/Qtopia/sharp/lib/libqte.so: undefined reference to `jpeg_write_scanlines\'
collect2: ld returned 1 exit status
make: *** [example] Error 1

My scripts now look like this:

#!/bin/bash
# dev-x86-qpe.sh script

CROSSCOMPILE=/opt/Embedix/tools/arm-linux/bin:/opt/Embedix/tools/bin
QPEDIR=/opt/Qtopia
QTDIR=/opt/Qtopia
PATH=${QTDIR}/bin:${QPEDIR}/bin:${PATH}:${CROSSCOMPILE}
TMAKEPATH=/opt/Qtopia/tmake/lib/qws/linux-x86-g++/
LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}
export QPEDIR QTDIR PATH TMAKEPATH LD_LIBRARY_PATH
echo \"Altered environment for Sharp Zaurus Development x86\"

#!/bin/bash
# dev-arm-qpe.sh script

CROSSCOMPILE=/opt/Embedix/tools/arm-linux/bin:/opt/Embedix/tools/bin
QPEDIR=/opt/Qtopia/sharp
QTDIR=/opt/Qtopia/sharp
PATH=${QTDIR}/bin:${QPEDIR}/bin:${CROSSCOMPILE}:${PATH}
TMAKEPATH=/opt/Qtopia/tmake/lib/qws/linux-sharp-g++/
#LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}
export QPEDIR QTDIR PATH TMAKEPATH LD_LIBRARY_PATH
echo \"Altered environment for Sharp Zaurus Development ARM\"

Thanks again for your help guys!

Doc
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Cross-Compile Basic Path Problem...help!!!
« Reply #8 on: March 17, 2004, 09:26:54 am »
So do you have libuuid.so.1 and libjpeg.so.62 in /opt/Embedix/tools/arm-linux/lib (the path\'s a guess)?
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #9 on: March 17, 2004, 09:35:16 am »
yes/no
libuuid.so is in /opt/Qtopia/sharp/lib which is in the -L on the compile...

/opt/Qtopia/sharp/lib/libuuid.sh -] libuuid.so.1.2
/opt/Qtopia/sharp/lib/libuuid.so.1 -] libuuid.so.1.2
/opt/Qtopia/sharp/lib/libuuid.so.1.2

Same with libjpeg...

/opt/Qtopia/sharp/lib/libjpeg.so -] libjpeg.so.62
/opt/Qtopia/sharp/lib/libjpeg.so.62

How in the heck do you guys that actually cross-compile do it?
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #10 on: March 17, 2004, 10:21:46 am »
I should have paid more attention to:

http://www.zaurususergroup.com/index.php?n...viewtopic&t=431

Basically I got it to compile by commenting out the LD_LIBRARY_PATH in the dev-arm-qpe.sh script, and adding the following line to the example.pro file:

TMAKE_LIBS = -luuid -ljpeg

I didn\'t change the tmake.conf in either directory (x86 or arm) and it works with qt 1.7 right out of the tar file.

Now...on to more interesting matters...

Thanks again for your help.  I wonder when Sharp is going to have their developers web back up again?????

Doc
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

BlackCardinal

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • http://www.gelhaus.net
Cross-Compile Basic Path Problem...help!!!
« Reply #11 on: March 17, 2004, 12:43:02 pm »
You know, instead of just commenting out the LD_LIBRARY_PATH lines you can change them to append library paths to an existing LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/more/paths/to/libs:/yet/another/lib/path
BlackCardinal : http://www.gelhaus.net : Zaurus page

SL-C1000, Cacko ROM v1.23
Lexar SD 512MB, Kingston CF 512MB
Symbol Spectrum24 CF 802.11b

SL-5500 Sharp ROM v3.10
Lexar SD 256MB
Pocketop keyboard, Nutshell 207 leather case

markb

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
Cross-Compile Basic Path Problem...help!!!
« Reply #12 on: March 17, 2004, 03:32:26 pm »
The fixed env setup script dev-arm-qpe.sh has been put in the downloads section.
The fiile linked from the compiler setup how-to has been updated too.

So hopeffully a few less people will be caught out by the LD_LIBRARY_PATH problem now.

I don\'t know if we can get the tmake.conf file fixed so it includes the missing libraries.
I think I got my QT sdk direct from Trolltech, and it had the problem.

- Mark

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Cross-Compile Basic Path Problem...help!!!
« Reply #13 on: March 18, 2004, 07:32:58 am »
@blackcardinal: But LD_LIBRARY_PATH should never be changed for a cross compile. LD_LIBRARY_PATH is not a search path for the gcc linker but rather a search path for the dynamic library loader, and you certainly don\'t want to try to load any ARM libs on an x86 machine, etc.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

BlackCardinal

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • http://www.gelhaus.net
Cross-Compile Basic Path Problem...help!!!
« Reply #14 on: March 18, 2004, 10:48:20 pm »
lardman,

That\'s a very good point.  Why would you need to change dynamic libraries for cross compiling?  Sorry, I guess wasn\'t thinking very thoroughly here.  I just saw there were library paths being changed and jumped to a conclusion. :oops:
BlackCardinal : http://www.gelhaus.net : Zaurus page

SL-C1000, Cacko ROM v1.23
Lexar SD 512MB, Kingston CF 512MB
Symbol Spectrum24 CF 802.11b

SL-5500 Sharp ROM v3.10
Lexar SD 256MB
Pocketop keyboard, Nutshell 207 leather case