Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on iPAQ?
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

Joined: 19 Oct 2004
Posts: 16

PostPosted: Fri Apr 21, 2006 11:48 am    Post subject: Gentoo on iPAQ? Reply with quote

I have been playing with gentoo for a couple of years now and I still prefer it to any other Linux distro.

Last week, I wanted to try something new and I looked into cross compiling a root file system for an old iPAQ, that I have lying around and now runs Familiar. Before people start telling me that it is better to stick with Familiar, let me tell you that it is not about being unsatisfied with Familiar, but wanting to try and build a rootfs myself for a change. Not sure that I will ever try to flash my iPAQ with it and that is not important (yet) for me.

I started out with emerging crossdev and building a cross toolchain, but to my surprise, that is as far as I could get without running into problems, and for once google is failing me. I have a couple of questions:

If I build the cross toolchain, crossdev uses /etc/make.conf to determine the optimizations (CFLAGS). However, when I try to emerge baselayout for the iPAQ, it tries to use the same settings and that is not what I want (-march=athlon does not work for arm). Of course I can change the CFLAGS, but this also holds for many of the other settings in make.conf, like the USE flags. Is there some easy way to override the make.conf for other targets?

Figuring out what to build is not trivial, but I tried baselayout-lite (everything is masked), baselayout (does not compile) and some other packages with the same or similar errors as results.

I typically type something like this:

ROOT=/export/iPAQ/devroot CHOST=arm-softfloat-linux-uclibc CBUILD=i686-pc-linux-gnu CFLAGS="-Os" CXXFLAGS="-Os" USE="" emerge baselayout

Of course, it could be that I am the only person doing this and that I should look closely to the configure scripts of the packages for baselayout and start submitting bug reports. However, as I am only doing this for less than a week, I might be just stupid and doing things the wrong way. Does anybody have any obvious hints/tips?


Back to top
View user's profile Send private message

Joined: 08 Apr 2006
Posts: 176
Location: your pineal gland

PostPosted: Sun Apr 23, 2006 3:40 am    Post subject: Reply with quote

Is there some easy way to override the make.conf for other targets?

In a word, no. I've been working with cross-compilers for mips and arm CPUs and am also frustrated by portage's lousy support for cross-compilation. I am working on the problem and have developed some scripts which I'm refining/testing that alleviate some of the annoyance, but it's a major problem either way, and something I would like to improve in portage.

The recommended practice is to make a wrapper around portage that sets up the cross-compile variables and then calls emerge.
A simple hack-type solution to improve on this is to build the wrapper, and then do something like this:

CFLAGS="-O2 -pipe -march=armv5te -mtune=xscale -fomit-frame-pointer -ffast-math ${CFLAGS}"

FEATURES="ccache buildpkg ${FEATURES}"
# this is a hack to negate all the normal flags that portage is otherwise going to cram onto my cross-compile
USE="-X -gnome -kde -alsa -emacs -xinerama -glibc-omitfp -hardened -ssh -apache -mysql"
# now we're going to include the real flags we want, first we unset all the crap we don't want, then set options we DO want
USE="${USE} make-symlinks pregen savedconfig uclibc uclibc-compat minimal buildpkg pregen readline zlib ${USE_OVERRIDE}"
[ -z ${PKGDIR} ] && PKGDIR=/export/iPAQ/devroot/portage/packages
[ -z ${ROOT} ] && ROOT=/export/iPAQ/devroot

emerge $@

put ALL your USE flags from make.conf in the first USE flag setting above, the idea is to negate all that so we can have only the flags you want set for the cross compile. since Portage will respect and give priority to the environment variable settings over make.conf when it sources that, the net effect will be to cancel out all the make.conf settings, then include only the flags we need.
i.e. portage will do this:
emerge saves the existing USE flag settings you specified (or the script specified and exported)
emerge sources /etc/make.conf --> a bunch of junk is now set
emerge sets USE flags it saved earlier --> all that junk is cancelled out as the new settings are read in

call it something like "cross-arm-softfloat-linux-uclibc-emerge" or equally easy to type :-), chmod +x the thing, and now you can

CFLAGS="-funroll-loops -finline-functions" USE_OVERRIDE="minimal ssl" cross-arm-softfloat-linux-uclibc-emerge busybox uclibc baselayout-lite coreutils

or whatever, and it will put the files in the proper ROOT, save binaries to an appropriate directory, and use your USE flags, and include your specific one-time USE flags if you specify them in the command, if you put them in under "USE_OVERRIDE".

a more clever hack would be to use sed to grab the USE flags out of make.conf, toss a "-" in front of them, and stick those into the USE environment variable, but this simpler approach should get the job done. This is an issue which I want to either see fixed or will fix myself in portage. The script I'm using now works with a different approach, but this is the type of thing I used first and it's less hack-ish if a bit inflexible. I whipped this up from memory so if there are mistakes or it doesn't work for you, let me know.
i7-3610QM | E5-2670 | FX-8300
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