I was successfully using crosstool 0.42 on my Mac until I upgraded to Leopard.
Then for
some reason the gcc executable which had reported itself as a Mach-O ppc
executable
suddenly claimed to be Mach-O 386, ie Intel. Since my Mac is indeed pre-Intel,
the
compiler and indeed all the rest of the toolchain had been broken.
I'm afraid my approach to getting it working again is not totally scientific,
it's a bit more
like hacking through a jungle. In other words, a series of point solutions
instead of the
elegant 'correct' approach. But it works for me and the built executables have
the same
MD5SUM as the previous ones.
1) Download crosstools 0.43 if you haven't already done so. Edit demo-arm.sh to
uncomment ONLY the line
eval `cat arm.dat gcc-3.3.4-glibc-2.3.2.dat` sh all.sh --notest
2) The first time you run ./demo-arm.sh it will donload everything you need.
Then when
it falls over, add '--nounpack' to the line above to stop it re-extracting and
writing over
any 'corrections' you have made.
3) The first problem comes when it is building binutils. The gcc supplied with
OSX, 4.1,
now defaults to producing a directory with symbols in it. For example, gcc
fred.c will
produse a.out and a directory a.outdSYM. This confuses configure which
complains that
the compiler does not work.
You cannot just set GCC_EXTRA_CONFIG=-g0 to suppress this, as this flag is
ignored. Edit
the Makefile in build-binutils/, line 146 and 220 to set
146: CFLAGS_FOR_BUILD = -g0 -O2
220: CFLAGS = -g0 -O2
4) Then, resuming, glibc complains it cannot be built without optimization. I
think I put a
-O into a CFLAGS somewhere, but I can't recall exactly where, as it was tied up
with a
more serious problem.
5) Building glibc-headers and glibc fails with version-info.h has amissing
terminator "
character. Indeed it does; this file in build-glibc-headers/csu and
build-glibc/csu is
generated by glibc-2.3.2/csu/Makefile around lines 226 and 231. For some
reason the
escaping of newlines doesn't work, so instead of getting "stuff\n" it produces
"stuff
"
I tried adding extra \ in front of the \n, but that didn't work as it shold, so
I just removed
them and it worked fine. Remember to delete version-info.h otherwise it won't
be rebuilt
correctly.
6) Success. You now probably have working gcc, ld, as and all the other stuff
you need.
But the test compilation of hello.c failed with 'PATH_MAX undeclared'. However,
the
programs I need to build for my TS7250(s) are built correctly and run properly,
and have
the same MD5SUM as the ones built before the upgrade, so that's a mystery Iam
not going
to lose sleep over.
As ever, hope this helps, and if there is a more permanent location for these
notes, that
would be great. I remember some mention of a Wiki?
Martin
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/
|