View previous topic :: View next topic |
Author |
Message |
mcc2 n00b
Joined: 06 Sep 2012 Posts: 25
|
Posted: Tue Nov 13, 2012 4:19 am Post subject: Crosscompiling for armv7a: Software accesses host files |
|
|
Hi,
my crosscompiling toolchain/environment is working so far now...
It is possible to successfully compile applications -- I tried it with
the midnight commander and ffmpeg successfully...
However:
For example compiling the boost library (which is used a lot)
failes to compile because the compilation process "breaks out"
of the cross compilation environment and accesses (binary) files
of the host system (amd64). It failes with something like "unknown file format".
Compiling this (and other) applications/libraries natively failes due to too
less memory ...
How can I fix that?
Thank you very much in advance for any help!
Best regards,
mcc |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Tue Nov 13, 2012 9:08 pm Post subject: |
|
|
mcc2,
The cross environment gets confused when you allow .la files to be installed there as they often tell where to find other things using an absolute path.
This naturally points to your host.
Add INSTALL_MASK="*.la" to make.conf and throw away all of the .la files in your target environment on the host too.
You may want to hide them before you delete them as there are one or two that are not linker related files.
You can also try distcc and cross compiling. This will help the speed but may not help the memory issue as linking is still done on the target.
Now your cross compiler is set up and working, the hard bit is done.
I can confirm that boost does build with the ARM cross compiler as I did it yesterday.
There is a minor gotcha with cross compiling. The cross toolchain appears to use a different name for ld than the targets native toolchain, as a result, nothing built with the cross compiler runs on the target.
You need to make a new symlink in /lib so the binaries from the cross compiler can find ld.
My Pi has Code: | roy@Pi_Net ~ $ ls -l /lib/ld*
-rwxr-xr-x 1 root root 134248 Nov 3 20:26 /lib/ld-2.16.so
lrwxrwxrwx 1 root root 10 Nov 3 20:32 /lib/ld-linux-armhf.so.3 -> ld-2.16.so
lrwxrwxrwx 1 root root 19 Nov 3 20:31 /lib/ld-linux.so.3 -> ld-linux-armhf.so.3 |
The new link is the last one. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
mcc2 n00b
Joined: 06 Sep 2012 Posts: 25
|
Posted: Wed Nov 14, 2012 3:08 am Post subject: |
|
|
Hi NeddySeagoon,
thank you for your reply and help! :)
In a first step I remaind all *.la file to *.la.off and the reported problem went away!
YEAH! Boost compiles without errors.
I want to preserve the possibility to eix-sync/emerge/compile on the target. Do I need the
*.la files again? Is it possible to fix the la-problem transparently -- for example to add $ROOT
in front of the absolute paths and to set $ROOT on the target to / ?
I tried distcc beofre and was disappointed.
The ld-fix (symlinking) seems not to be necessary here: I cross-built "arss"
without that symlink and it runs fine on the target.
Is there a way to update /var/log/emerge* on the target when crosscompiling?
Thank you very much in advance for any help!
Best regards,
mcc
PS: There is a new "old" problem with *la-files.
I tried to emerge gtkdatabox, which archive comes already with a
libgladedatabox.la, which in turn accesses /usr/lib/libglade, which
fails, becaus it is amd64 and not armv7a. I cannot move the la-file
away in the middle of the linking process...
And fixing the la-file after the process fails in /var/tmp/portage/...
does also not work, because restarting the emerge process will
again unpack the archive and everything starts right from the
beginning. End of the road, here? Or is there another handy trick? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|