Comparing Bill and Karim's cross-compile scripts. Updating Bill's to gcc 3.2.3.
Bill Gatliff
bgat@billgatliff.com
Sat May 17 18:42:00 GMT 2003
Karim et al:
>Lately, though, I was thinking about making a list of all available
>scripts, and I came up with this (which, of course, includes Bill's
>script):
>http://www.embeddedtux.org/pipermail/etux/2003-May/000018.html
>
That's a nice resource.
>The copying of asm-generic was added following a recommendation by Russell
>King, maintainer of the Linux ARM port.
>
I can confirm that copying of asm-generic is required for MIPS targets
as well.
>The way I see it, and the way I tried to word it in the book, is that this
>is really just good practice, because if you don't use CROSS_COMPILE=
>all the time, you end up forgetting to use it when you need to. You can
>skip it if you know what you're doing, as I suggest in the book.
>
Ditto. In my classroom experience, I've found it less error-prone to
teach everyone to specify CROSS_COMPILE as well. Over time, as their
skills improve, they "discover" how to fix it for themselves. Provides
a nice opportunity for a "teaching moment".
>I haven't really found this to be a show-stopper in the cases I've
>tested.
>
I think this is probably a holdover from my experiences with older
versions of glibc.
>Actually I found this the hard way. I used to put --prefix=$PREFIX,
>just like most cross-setup tool instructions out there do,
>but then I'd have to set LD_LIBRARY_PATH on the target, which sounded
>odd. And sure enough, a few reviewers pointed out during the review that
>a correctly build toolchain shouldn't need LD_LIBRARY_PATH=/lib. So I
>scratched my head a little more, RTFM'ed, tried a couple of things, and
>found that /usr is the only proper setting for --prefix here.
>
>As for "--prefix=/usr" being a special case for Linux, this is straight
>out of the GLIBC build instructions. In the "Specific advice for Linux
>systems" section of the INSTALL file, it says:
>" Linux expects some components of the libc installation to be in
>`/lib' and some in `/usr/lib'. This is handled automatically if you
>configure glibc with `--prefix=/usr'. If you set some other prefix or
>allow it to default to `/usr/local', then all the components are
>installed there."
>
That's pretty much how I got to where I am now, trial and error. :^(
Those experiences haven't found their way back into the
build-crossgcc.sh script, mostly because that script was originally
intended for non-linux targets. I was under the impression at the time
that crossgcc was mainly about non-linux targets, and that users of the
script wouldn't want to see the additional complexity required to build
a linux toolchain. Perhaps times have changed?
>I have tried to keep the instructions identical in as much as possible
>across all archs. There are some archs which require a few tricks,
>that's true. In as far as a comparison is made between instructions,
>however, I do cover all the *Linux* arch-specific tricks I can see in
>Bill's script. Most notably, the -Dinhibit_libc hack for ARM is covered
>in table 4-2 on p.111.
>
It's unfortunate that the instructions aren't identical across all
architectures. Maybe someday.
b.g.
--
Bill Gatliff
bgat@billgatliff.com
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list