ts-7000
[Top] [All Lists]

[ts-7000] Re: How to make an EABI cross compiler for ts boards, step by

To:
Subject: [ts-7000] Re: How to make an EABI cross compiler for ts boards, step by step
From: "Doug" <>
Date: Sat, 15 Aug 2009 04:50:59 -0000
--- In  "Dunge2" <> wrote:

Hi Dunge2,

> I'm having a bit of trouble of what to do next though. If I understood 
> correctly, I can use this toolchain to build optional libs with all their 
> dependencies, which I would then copy to the ts-provided debian-armel rootfs 
> to use them.

Andy's toolchain is really designed for creating your own root file system from 
scratch, which would mean compiling everything yourself. if you want to combine 
with other libraries, programs, etc. that are already on TS's debian armel 
rootfs, you would want to match up the compiled glibc version to the one on 
their rootfs (I don't know what it is).

> So I want to build multiple libs from source to create some kind of rootfs 
> with everything under the sys-root directory.
> 
> I want to build to following libs (not in this order):
> glib, gtk+, pango, pixman, cairomm, cairo, libsigc++, glibmm, fontconfig, 
> gtkmm, freetype, glade3, libglademm. I guess cairo and freetype can gain a 
> lot from the FPU support.

Ah, I see. So I think we are on the same page. :)

This should be doable. Note that just EABI by itself will help things out 
immensely, but to gain the extra help from the MaverickCrunch, you'll also need 
to add some CFLAGS when you compile libraries/programs that are using floating 
point operations. See the "using it" section on Martin Guy's MaverickCrunch 
patch site: http://martinwguy.co.uk/martin/crunch/

> I have set the following envvar:
> CPPFLAGS="-I/home/dunge/x-tools/arm-ep9312-linux-gnueabi/arm-ep9312-linux-gnueabi/sys-root/usr/include"
> LDFLAGS="-L/home/dunge/x-tools/arm-ep9312-linux-gnueabi/arm-ep9312-linux-gnueabi/sys-root/usr/lib"
> PKG_CONFIG_PATH="/home/dunge/x-tools/arm-ep9312-linux-gnueabi/arm-ep9312-linux-gnueabi/sys-root/usr/lib/pkgconfig"
> LD_LIBRARY_PATH="/home/dunge/x-tools/arm-ep9312-linux-gnueabi/arm-ep9312-linux-gnueabi/sys-root/usr/lib"
> PATH="/home/dunge/x-tools/arm-ep9312-linux-gnueabi/arm-ep9312-linux-gnueabi/sys-root/usr/bin:/home/dunge/x-tools/arm-ep9312-linux-gnueabi/bin:$PATH"
> export CPPFLAGS LDFLAGS PKG_CONFIG_PATH LD_LIBRARY_PATH PATH

You shouldn't need to set all these environment vars other than PATH. The cross 
compiler is aware enough to search in its lib and include directories in the 
sys-root/usr directory. You probably shouldn't include the sys-root/usr/bin in 
your path because it will contain ARM binaries, but for sure you need the other 
folder you added to your PATH.

I take that back--PKG_CONFIG_PATH is also necessary, good thinking. I would 
also set PKG_CONFIG_LIBDIR to the same thing just in case.

> I then call the libs configure script with these parameters:
> --host=arm-ep9312-linux-gnueabi 
> --prefix=/home/dunge/x-tools/arm-ep9312-linux-gnueabi/arm-ep9312-linux-gnueabi/sys-root/usr

Looks good. Actually I would do --prefix=/usr or /usr/local or wherever you 
plan on it being on the TS-7390 itself. Don't worry...when we do make install 
we will add an option to tell it to put it in your x-tools directory.
> 
> Problem is, when I run make and make install afterward, it still try to link 
> against libs and include files in /usr/* and obv fail.

Yeah, some packages don't support the --host stuff, but most do. For the other 
ones you may have to actually export the CC, LD, AR, RANLIB environment 
variables to point to the arm variants and then just do a normal configure and 
make. If all else fails on a particular package, I usually google it and 
someone else has instructions on how to do it.

Sometimes evil configure scripts look for headers in /usr too...in that case 
you might have to patch the configure script to do what it's supposed to be 
doing.

When you do make install, do this:

make DESTDIR=./_install install. it'll pretend that the folder _install in your 
current directory is actually the root directory of your system when it 
installs. Then you can tar up the contents of the _install folder and extract 
them on the root of your file system on the TS-7390. Then you can run the 
install command again with DESTDIR=/path/to/x-tools/.../sys-root, or just copy 
the contents of _install into the sys-root folder (be sure to chmod -R +w the 
sys-root folder, it's write-protected by default).

Some packages don't support DESTDIR, but for them you should be able to just 
manually copy over the libs/include files, or find a good alternative. Another 
annoyance, I know...:-(
 
> I understand some libs needs other customs configure commands, likes 
> --sysconfdir or --with-arch, or god know what. I could make everything point 
> to the crosstool sys-root path, but how do you know what you should pass when 
> it's documented nowhere?.

I hear ya there...I was dealing with this today while building a few packages. 
It seems to mostly be older stuff that used older versions of autoconf, or 
packages that do nonstandard stuff. Otherwise I just look at the Makefile and 
configure scripts to try to get a good idea. Usually the ones that don't work 
with ./configure --host work by setting CC, LD, etc. as i mentioned earlier.

I completely understand how annoying it is to compile this stuff from scratch. 
These instructions probably sound insane. It's a huge pain...but after doing 
it, it's really helped me get better with cross compiling. The knowledge gained 
is definitely worth it :-) It makes me feel better knowing exactly what is 
going into my file system. It also makes it easier to keep track of everything 
you've used in your project, so you can make sure you're completely compliant 
with licenses. It just takes some getting used to, because apt-get is so much 
easier!

I hope this helps...hope it wasn't too much of a mouthful!



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU