Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
help with crossdev [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
kevintshaver
n00b
n00b


Joined: 14 Feb 2006
Posts: 49

PostPosted: Sun Mar 10, 2013 9:11 pm    Post subject: help with crossdev [solved] Reply with quote

[quote]I'm trying to cross compile packages for arm on my x86 system. I followed this guide:

http://www.gentoo.org/proj/en/base/embedded/cross-development.xml

Everything seems to go pretty well. I ran
Code:
xmerge pciutils
to test it out and it finished w/o error. Now, can someone help me figure out how to get the pci-utils package moved over to the arm machine? I set PKGDIR variable on the host machine's make.conf in /usr/armv6j-hardfloat-linux-gnueabi/etc/make.conf to
Quote:
PKGDIR="/usr/armv6j-hardfloat-linux-gnueabi/bpackages"[/code] but it ignores this and creates pciutils-3.1.10.tbz2 in /usr/armv6j-hardfloat-linux-gnueabi/packages/sys-apps. Any idea why my PKGDIR isn't working?


Also, I copy this package file over to the arm machine and try running
Code:
emerge -pKv pciutils
and I get
Code:
emerge: there are no ebuilds to satisfy "pciutils".
I've tried saving the tbz2 file in /usr/portage/packages, /usr/portage/pacakges/All, /usr/portage/packages/sys-apps, and /bpackages. On the arm machine I have /etc/make.conf PKGDIR set to /bpackages.


Last edited by kevintshaver on Mon Mar 11, 2013 7:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54619
Location: 56N 3W

PostPosted: Sun Mar 10, 2013 9:34 pm    Post subject: Reply with quote

kevintshaver,

How are you getting a portage tree on your ARM ?
The emerge error says at least a part of it is missing, it mentions the ebuild, not the binary package.

You can make your x86 box a BINHOST, to serve the ARM packages, or set up NFS, or use scp or rsync ....

I think
Quote:
... make.conf in /usr/armv6j-hardfloat-linux-gnueabi/etc/make.conf ...
is ignored. It needs to be in /usr/armv6j-hardfloat-linux-gnueabi/etc/portage/make.conf
Note the ../portage/ in the path.

There is another gotcha for cross complied packages. The cross compiled packages look for ldd with the wrong name. You need to add a symlink to fix it.

Code:
$ ls /lib/ld* -l
-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
On my Raspberry Pi, the native build system uses /lib/ld-linux-armhf.so.3 but my amd64 build box plants /lib/ld-linux.so.3. I'm not sure if thats a feature or a bug. The error message you get for that is very misleading.

lspci on a Pi is not very interesting as it doesn't have a PCI bus.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kevintshaver
n00b
n00b


Joined: 14 Feb 2006
Posts: 49

PostPosted: Sun Mar 10, 2013 10:36 pm    Post subject: Reply with quote

Thanks for the fast feedback Seagoon. The portage tree is all setup. I can install it no problem if I just do
Code:
emerge pciutils
. It's only when I try to do the install from the binary
Code:
emerge -K pciutils
that it can't find the package. I know lspci is not that important (apparently completely non-relevant on Raspberry Pi), I'm just using it cause its quick to test the process out.

Quote:
You can make your x86 box a BINHOST, to serve the ARM packages, or set up NFS, or use scp or rsync ....

I will eventually set up the BINHOST but can you explain more on using scp or NFS? I don't see how I can tell emerge the location of the binary other than setting PKGDIR in make.conf. I did use scp to transfer over the file pciutils-3.1.10.tbz2 from host to RPi. I just can't seem to get the system to look for it in the correct location.

You were right about make.conf at /usr/armv6j-hardfloat-linux-gnueabi/etc/make.conf being ignored. I moved it and now it's being used by emerge. I can flip use flags. So the host is all set, just can't get the binary package installed on the target.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54619
Location: 56N 3W

PostPosted: Sun Mar 10, 2013 11:09 pm    Post subject: Reply with quote

kevintshaver,

emerge --info
On my Pi PKGDIR="/usr/packages" works

armv6j-hardfloat-linux-gnueabi-emerge --info
Its matched by PKGDIR="/usr/armv6j-hardfloat-linux-gnueabi/packages/" on my build host.

That contains
Code:
# ls "/usr/armv6j-hardfloat-linux-gnueabi/packages/"
Packages     app-text    media-fonts  net-misc   sys-kernel   x11-libs
app-admin    dev-db      media-gfx    net-nds    sys-libs     x11-misc
app-arch     dev-lang    media-libs   perl-core  sys-process  x11-proto
app-dicts    dev-libs    media-sound  sci-libs   virtual      x11-terms
app-editors  dev-perl    net-fs       sys-apps   www-servers  x11-themes
app-misc     dev-python  net-irc      sys-auth   x11-apps     x11-wm
app-portage  dev-util    net-libs     sys-devel  x11-base
app-shells   mail-mta    net-mail     sys-fs     x11-drivers

You certainly need the directory structure and you probably need the Packages file too. Each dir contains the binary packages.

You will hate pure cross compiling as many things won't build. A good compromise is to install distcc on the Pi and the build host.
Run the distccd on the build host, so it listens put distcc in FEATURES on the Pi, then tell the Pi
Code:
pump emerge <package>

You need identical versions of gcc on the Pi and for your cross compiler, but you can cross compile gcc for the Pi.

My Pi runs MAKEOPTS="-j8", which is good until you come to a package tat won't use distcc.
You will die of old age building on the SD card too. Set up NFS or a USB hard drive for everything except /boot.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kevintshaver
n00b
n00b


Joined: 14 Feb 2006
Posts: 49

PostPosted: Mon Mar 11, 2013 7:48 pm    Post subject: Reply with quote

OK, thanks for the help on the problem and the extra tips. You got it right here:

Quote:
You certainly need the directory structure and you probably need the Packages file too. Each dir contains the binary packages.


I emerged using buildpkg on the target and that created the Packages file and added in the sys-apps directory in my PKGDIR folder. That is all it needed, now I can emerge -K without issue as long as I add the binary to the appropriate category directory.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
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