OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: Bebe on March 16, 2004, 01:40:48 pm

Title: Cross compiling issues
Post by: Bebe on March 16, 2004, 01:40:48 pm
Hi all,
  I\'m having an issue with cross compiling for the Z and I\'m beating my head against the wall trying to figure it out.  When I compile a simple hello world program in C++ using stl, I get a binary that is over 3MB, even when compiling in release mode with optimizations turned on.  When I remove all references to stl and compiled the program again, and binary still turns out to be 3MB.  Any thoughts??

Bebe
Title: Cross compiling issues
Post by: rrusaw on March 16, 2004, 02:16:59 pm
Check to make sure you are performing dynamic linking.
Title: Cross compiling issues
Post by: Bebe on March 16, 2004, 02:46:13 pm
Quote
Check to make sure you are performing dynamic linking.

Thanks for the reply.
I compiled using \"-Wl,-Bdynamic\", but the binary is still 3MB.

Bebe

PS, I\'m using zgcc 3.3.1
Title: Cross compiling issues
Post by: lardman on March 16, 2004, 05:11:58 pm
Have you stripped it? (you say release mode, but I don\'t know whether that has actually stripped it, though I\'d assume it has from the name).

Si
Title: Cross compiling issues
Post by: Bebe on March 17, 2004, 10:26:54 am
Quote
Have you stripped it? (you say release mode, but I don\'t know whether that has actually stripped it, though I\'d assume it has from the name).

Si

Thanks for replying lardman,

At first, I compiled my program like this:
Code: [Select]
g++ -Wall -g -o hello hello.cpp

Then like so,
Code: [Select]
g++ -Wall -02 -o hello hello.cpp

Then like this,
Code: [Select]
g++ -o hello hello.cpp

Finally, I did this

Code: [Select]
g++ -Wl,-Bdynamic -o hello hello.cpp

And I did this to both code that had stl and code that had non-stl references. All of this resulted in a 3MB file.

The interesting this is that when I used zgcc 3.3.2 to compile, I got a file that was much smaller. My guess is that some of the libs that came with the version of zgcc 3.3.1 were in debug mode.  Oh well, 3.3.2 it is