Resulting files from canadian cross

Maurits van de Kamp
Thu Mar 22 16:14:00 GMT 2007

> So anyone who tries to build a GCC for Linux, is expected at least to
> know the '/lib', '/usr/lib'', '/usr/include',
> '/usr/X11R6/lib'' and '/usr/X11R6/include' as the places for the Linux
> C
> libraries and be capable to copy
> or unpack these into some chosen $sysroot on the cross host system.
> And
> then use the
> '--with-sysroot=$sysroot' to point to them when configuring binutils
> and
> GCC...

Well I sort of know them, but there's gazillions of files I'm supposed
to know are supposed to be some place and I don't seem to know them all.

Anyway, I kinda succeeded now in making a sensible filetree for my
Arm-native compiler. I did it by creating the cross compiler with
crosstool but 'manually' making the native one. (By building and
installing gcc, glibc, binutils and the kernel headers produced by
crosstool). I learned enough from all my previous attempts and your
extensive information in your mails. The fact that they are full of
things that are apparantly obvious, but I didn't know them and I don't
see them documented anywhere, illustrates my problem. :o) Still, it
works - almost. I made an /usr/arm on my host PC and used it as a target
for everything I cross-compile. By also using /usr/arm (instead of
/usr/local/) on the Arm (for some reason some absolute paths still
appear to be hardcoded even though this apparantly shouldn't be the case
anymore since gcc 3.4.something), I can get everything working there as

That is, I still have a mysterious /usr/arm/arm-unknown-linux-gnu
resulting from one of the make installs, with some binutils that are
binary identical to the ones in /usr/bin but hey, I don't want to be
fussy. :o)

I can now compile and run an ansi-C helloworld.c on the Arm. (Wohoo!)
:o) However, c++ is giving problems. I made a c++ helloworld, and
compiled it successfully with g++. When I try to run it, first is not found (which is in /usr/arm/lib but looked for in
/lib). After symlinking everything in /usr/arm/lib to /lib (just for
now, I will figure out what goes where later) :) and try to run my c++
helloworld again, I get:

./helloworld2: /lib/ version `GCC_3.4' not found (required
by /lib/

Now this error totally baffles me. I'm using gcc 4.0.2 and glibc 2.3.6,
totally compatible, now why is it looking for 3.4 and why does the
linker care about finding gcc at all? What exactly does it want from me?
My best guess would be it wants a compiler (or to be compiled with a
compiler) greater than 3.4, but how can I convince libgcc that it is?

(Maybe this is getting off-topic, but hey it's a cross-compiled c++
that's not working) :)

> Generally producing a cross GCC fully normally requires one only know
> how to copy files, maybe how to
> add a couple of symlinks and how to use an editor, etc. ie. have some
> simple skills.

Well no I don't agree there. I know how to copy files, add symlinks, use
an editor etc. But that doesn't give me the slightest clue what on earth
I'm supposed to symlink and copy where. All documentation I find only
tells me bits and assumes some magical knowledge I guess should have
been imprinted in my brain by evolution. :o)

Anyway, seems like I'm almost there. Thanks for your help so far Kai, I
got a lot futher and learned a lot too in the last few days. I hope I
figure out this libgcc problem too and that it'll be the last snag. :o)


For unsubscribe information see

More information about the crossgcc mailing list