This is the mail archive of the crossgcc@sourceware.org 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: crosstool OS X host -> sparc/linux target?



Am 09.09.2005 um 18:18 schrieb Dan Kegel:


Have you read
http://kegel.com/crosstool/current/doc/crosstool-howto.html#mac
?  It doesn't sound like it, offhand.  You most certainly
can use gnu ld and as; crosstool is going to be generating
Linux binaries, not Mac OS X binaries.

Hello and thank you for the fast reply.


Of course, I've read the howto - and I understood it, too. I'm sorry that I've expressed myself unclearly. What I meant was that MacOS cannot use plain vanilla gnu binutils to create Mach-O binaries, and that's why the patch was needed to ignore the version numbers of macos' as & ld. It's totally clear for me that I build here a compiler and tools like assambler, linker, etc (which ARE Mac binaries) that produce code for sparc/linux (= Linux binaries) and this code needs the gnu binutils.

After applying the patch, the compilation stopped while building the glibc headers. The compiler couldn't find a path to stddef.h. (The same happened while trying to build für i686 just for verification). So I copied $HEADERDIR/linux/stddef.h to $HEADERDIR/stddef.h and the compilation went fine

That sounds familiar. Maybe if you pasted in the few lines in the log around the error, I could dredge it up.

TOP_DIR=/Developer/sparc/crosstool-0.38
BUILD_DIR=/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux- gnu/gcc-3.4.
4-glibc-2.3.5
PREFIX=/Developer/sparc/crosstool/gcc-3.4.4-glibc-2.3.5/sparc-unknown- linux-gnu



make[1]: Entering directory `/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/glibc-2.3.5'
{ echo '#include "posix/bits/posix1_lim.h"'; \
echo '#define _LIBC 1'; \
echo '#include "misc/sys/uio.h"'; } | \
gcc -E -dM -MD -MP -MF /Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers/bits/stdio_lim.dT -MT '/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers/bits/stdio_lim.h /Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers/bits/stdio_lim.d' \
-Iinclude -I. -I/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers -Ilibio -I/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers -Isysdeps/sparc/sparc32/elf -Isysdeps/unix/sysv/linux/sparc/sparc32 -Isysdeps/unix/sysv/linux/sparc -Isysdeps/unix/sysv/linux -Isysdeps/gnu -Isysdeps/unix/common -Isysdeps/unix/mman -Isysdeps/unix/inet -Isysdeps/unix/sysv -Isysdeps/unix/sparc -Isysdeps/unix -Isysdeps/posix -Isysdeps/sparc/sparc32/fpu -Isysdeps/sparc/sparc32 -Isysdeps/wordsize-32 -Isysdeps/ieee754/flt-32 -Isysdeps/ieee754/dbl-64 -Isysdeps/sparc/sparc32/soft-fp -Isysdeps/sparc/fpu -Isysdeps/sparc -Isysdeps/ieee754 -Isysdeps/generic/elf -Isysdeps/generic -nostdinc -isystem include -isystem /Developer/sparc/crosstool/gcc-3.4.4-glibc-2.3.5/sparc-unknown-linux- gnu/sparc-unknown-linux-gnu/include -xc - -o /Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers/bits/stdio_lim.hT
In file included from posix/sys/types.h:31,
from include/sys/types.h:1,
from misc/sys/uio.h:24,
from <stdin>:3:
sysdeps/generic/bits/types.h:31:20: No include path in which to find stddef.h
In file included from include/sys/types.h:1,
from misc/sys/uio.h:24,
from <stdin>:3:
posix/sys/types.h:147:20: No include path in which to find stddef.h
make[1]: *** [/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/build-glibc-headers/bits/stdio_lim.st] Error 1
make[1]: Leaving directory `/Developer/sparc/crosstool-0.38/build/sparc-unknown-linux-gnu/gcc -3.4.4-glibc-2.3.5/glibc-2.3.5'
make: *** [install-headers] Error 2



The interesting part is that stddef.h resides in /Developer/sparc/crosstool/gcc-3.4.4-glibc-2.3.5/sparc-unknown-linux- gnu/sparc-unknown-linux-gnu/include/linux. So apparently either the option "-isystem /Developer/sparc/crosstool/gcc-3.4.4-glibc-2.3.5/sparc-unknown-linux- gnu/sparc-unknown-linux-gnu/include" should provide recursivity for looking in subfolders or there should be another include path to point directly to the kernel headers.



There's at least one other report of this:
http://lists.ibiblio.org/pipermail/sm-grimoire-bugs/2005-August/ 000961.html


Yes, it's a bug report without a solution.

There some other references for an ARM port: http://sourceware.org/ml/libc-alpha/2002-05/msg00203.html but the suggestion in http://sourceware.org/ml/libc-alpha/2002-05/msg00204.html is inacceptable since we know, that glibc-2.3.5 DOES work on SPARC.


Try installing Fink's ld and as... can't hurt.
Maybe the real fix for your stddef.h problem would help, too.
- Dan

After some digging in Fink I found out that Fink creates either a virtual package for the cctools included in XCode 1.5 or it installs a newer version avaiable at http://www.opendarwin.org/projects/odcctools/. (cctools includes as, ld and some other tools) I'll try it as soon as I can. It takes about 2.5h to the point where the compilation fails. ;-)


Some thoughts: The compilation fails while compiling glibc. At this stage the core cross compiler (gcc-core) is used. So assuming that the same toolchain builds correctly and works when compiled on x86/linux (and this is proven), there may be a flaw with the headers or the gcc-core. So maybe it was a mistake to copy only stddef.h?

Tom


------ 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]