(Fwd) Re: cross-compiling problems
Kai Ruottu
kai.ruottu@luukku.com
Thu Oct 10 09:05:00 GMT 2002
"azmir ibrahim" <el_caracos@hotmail.com> wrote:
> hello...i need some help here on building a cross compiler on RedHat 7.2 for
> solaris2.5.
> i already downloaded gcc-2.95.3 , newlib-1.10.0 and binutils-2.13
Why newlib ?
> the next step is building a bootstrap gcc
You don't need any 'bootstrap GCC' for the target because your
native GCC is this and will be used to compile the cross-GCC...
In a native build the native 'cc' (not GCC) or an old GCC, the
'bootstrap compiler', will be used to build the 'stage1' compiler.
Solaris2-users normally download the first GCC used to compile
the GCC-sources from 'www.sunfreeware.com'.
With RedHat 7.2 people could argue about which would be the best
'production GCC': the provided 'gcc-2.96-110' (or something), the
old reliable 'gcc-2.95.3' or the 'RH 6.2-compatability-egcs-1.1.2'...
I have used gcc-2.95.3 with glibc-2.1.3...
> $ ../gcc-2.95.3/configure --prefix=/root/crosser/sparc
> --target=sparc-sun-solaris2.5 --without-headers --with-newlib
The last two options are pure bullshit and should be left away.
Instead the '--enable-shared --enable-threads' could be used in
order to get a shared 'libstdc++.so' and the threads support.
The 'posix' or 'solaris' threads could work, quoting the GCC's
config-template for 'sparc-solaris2*' :
if test x${enable_threads} = x; then
enable_threads=$have_pthread_h
if test x${enable_threads} = x; then
enable_threads=$have_thread_h
fi
fi
if test x${enable_threads} = xyes; then
if test x${have_pthread_h} = xyes; then
thread_file='posix'
else
thread_file='solaris'
fi
fi
;;
I have trusted the '--enable-threads' (without '=posix' or
'=solaris') giving the right choice, I'm not a threads-expert...
> $ make all-gcc install-gcc
The 'make' should (theoretically) build everything...
> An error has occured in this step.Here is the error:
>
> In file included from gthr-default.h:1,
> from ../../gcc-2.95.3/gcc/gthr.h:98,
> from ../../gcc-2.95.3/gcc/libgcc2.c:3034:
> ../../gcc-2.95.3/gcc/gthr-posix.h:37: pthread.h: No such file or directory
The Solaris2.5 headers and libraries should be preinstalled into:
$prefix/$target/sys-include
and
$prefix/$target/lib
(the 2.5-headers probably need more fixing than only for the
'math.h'), before starting to configure and build GCC. Please see
my reply to another message about this Solaris2.x subject, some
other things probably must be done too...
> I am hoping somebody can help me.I already read the tutorial and
> manual but i still cannot compile the gcc.
The GCC-manual ("Using and Porting...") ? If so, how did you avoid
reading about copying and installing the target libs and headers into
the same directory ($prefix/$target) with the target binutils?
Cheers, Kai
------
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