This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Succes using crosstool on Mac OS X


Dave wrote:
Martin> Finally, when crosstool wants to install the glibc headers, it
Martin> unfortunately tries to compile glibc with the platform's
Martin> native toolchain. Glibc's configure script does "as
Martin> --version", which is not understood by Apple's assembler,
Martin> which then waits for a file to compile on standard input,
Martin> which stalls everything.

I got past this by just removing the "as --version" check from the
configure.in file and running autoconf.

Martin> I solved that problem by first creating a cross-compiler
Martin>[...]
I don't understand how this solves the problem.  Doesn't "as" have to
be a native as?  How would using a powerpc assembler allow you to
build a cross compiler that actually runs on the Mac?

Today I found a much easier to solution to my last problem:


--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
@@ -3789,7 +3789,7 @@
# Found it, now check the version.
echo "$as_me:$LINENO: checking version of $AS" >&5
echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ ac_prog_version=`$AS -v < /dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2.1[3-9]*)


Since only the headers need to be built and no objects, the native as works as well.
The "-v < /dev/null" construct works for both GAS and Apple's as. Unfortunately, it does not output the same thing as "as --version" for GAS, although the difference is probably not critical:


$ /opt/crosstool/powerpc-750-linux-gnu/gcc-3.3.2-glibc-2.3.2/bin/powerpc -750-linux-gnu-as -v < /dev/null
GNU assembler version 2.14 (powerpc-750-linux-gnu) using BFD version 2.14 20030612
$ /opt/crosstool/powerpc-750-linux-gnu/gcc-3.3.2-glibc-2.3.2/bin/powerpc -750-linux-gnu-as --version
GNU assembler 2.14 20030612
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `powerpc-750-linux-gnu'.


So, in summary, all that is required to build crosstool-0.27 on Mac OS X targetting powerpc-750-gnu-linux is the above patch and the patch of my first mail to this list.

Martin


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]