Newbie can't build linux cross-compiler for solaris
David Thompson
David.Thompson@efi.com
Thu Aug 30 16:34:00 GMT 2001
Hi Tom, thanks for the reply!ÃÂ I studied it for a
few
minutes, 1st let me make sure I point out what I'm
trying
to do, because (I think) you're suggesting a radically
new
& different approach.
ÃÂ
First, I want a gcc cross compiler that runs on Solaris
but
produces Linux
executables.
ÃÂ
So, I've been trying to build this cross compiler on
Solaris,
since that is where it must run, but it would seem you
are
suggesting I build this cross compiler
on the Linux
box
itself.
ÃÂ
Is that correct?ÃÂ That's a completely new approach
for me,
and since I *do* have a Linux box to play with, I can
try
building it from LinuxÃÂ ... Hmmm
...
-----Original Message----- From:
Tom.Williams@diversifiedsoftware.com
[mailto:Tom.Williams@diversifiedsoftware.com] Sent: Thursday, August
30, 2001 3:38 PM To: David.Thompson@efi.com Subject: Re:
Newbie can't build linux cross-compiler for
solaris Here is a basic
procedure you can try: 1. Tar up
the Solaris header files in /usr/include: $ tar cf headers.tar /usr/include 2. Tar up the libs you will need to use the cross-compiler:
$ tar cf libs.tar /usr/lib/libc.a
/usr/lib/libC.a /usr/lib/libm.a ( your
list may vary. ÃÂ Try to pick the handful of libs you think you will need.
ÃÂ At the very minimum, get the C (libc.a and libC.a (I think) and math
(libm.a)) 3. Transfer these files
to the Linux box AT the LINUX
box: 4. Extract headers.tar and
libs.tar somewhere. ÃÂ I recommend making a directory (like crossdata) and
untar those files in the crossdata directory. ÃÂ That will create
crossdata/usr/include/.... and crossdata/usr/lib/...... 5. Obtain binutils2.11.2.tar.gz (from sourceware
http://sources.redhat.com/binutils/) and gcc-2.95.3 from the gcc guys
(http://gcc.gnu.org/) 6. Build
bintuils: PATHTOBINUTILS/configure ÃÂ --prefix={installtion directory
for cross tools} --host=$YOURHOST --target=$YOURTARGET ÃÂ , where
YOURHOST={hw
platform}-linux-gnu and
YOURTARGET=sparc-sun-solaris2.7 (or 2.6) make Make install 7.Build GCC: PATHTOGCCSRC/configure --prefix={installation
directory for cross tools} --host=YOURHOST --target=YOURTARGET
--with-gnu-ld --with-gnu-as --with-headers={place where headers.tar was
extracted} --with-libs={place where libs.tar was extracted} make make
install If you have problems with
libgcc1.a not being properly built, try the steps below:
On YOURTARGET: Build binutils, at a minimum copy
all executable to OBJECTDIR on target configure gcc
with: $PATHTOGCCSRC/configure --host=$YOURHOST --target=$YOURTARGET
--with-gnu-ld --with-gnu-as make libgcc1.a ÃÂ ÃÂ ÃÂ
ÃÂ #Now save libgcc1.a. ÃÂ This is how you get this file. make
distclean $PATHTOGCCSRC/configure make enquire enquire -f >
float.h ÃÂ ÃÂ ÃÂ ÃÂ # you might need this enquire -l >
limits.h ÃÂ ÃÂ ÃÂ ÃÂ # and this I first went through at least 1.5 years ago and have since then
nuked my cross compiler. ÃÂ This procedure will probably NOT work the first
time, but with patience it can be tweaked to work. Let me know how far I get and hopefully, I will have mine built to
answer any questions you might have. Good
luck! Peace......
Tom
My DVD
Collection
David Thompson
<David.Thompson@efi.com> Sent by: crossgcc-owner@sources.redhat.com
08/30/01 02:50 PM
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ To: ÃÂ ÃÂ
ÃÂ ÃÂ 'crossgcc' <crossgcc@sourceware.cygnus.com>
ÃÂ ÃÂ ÃÂ ÃÂ cc: ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ
ÃÂ ÃÂ ÃÂ Subject: ÃÂ ÃÂ ÃÂ ÃÂ Newbie can't
build linux cross-compiler for
solaris Hi there,
I am a newbie at building a cross
compiler so I'm trying to read everything I can find, but I've
failed in all my attempts to build a Linux gcc cross-compiler
than runs on Solaris. ÃÂ Here is my simple
script,
ÃÂ #!/bin/ksh GCC=gcc-2.95.3
BINUTILS=binutils-2.10.1
TARGET=i686-pc-linux-gnu
SRCDIR=/home/davidt/gnu/src/sun BINDIR=/home/davidt/gnu/bin/sun
ÃÂ cd $SRCDIR mkdir build-binutils build-gcc
ÃÂ # configure, build and install
binutils cd build-binutils ../$BINUTILS/configure --target=$TARGET --prefix=$BINDIR
-v make all install
ÃÂ # configure, build and install
gcc cd ../build-gcc ../$GCC/configure --target=$TARGET --prefix=$BINDIR -v make all install
I have untarred the packages into
/home/davidt/gnu/bin/sun,
and binutils builds fine.
ÃÂ The error I get is from building gcc, here is the
[slightly formatted] error output,
ÃÂ for name in _muldi3 _divdi3
_moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 \ ÃÂ _ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2
_ucmpdi2 \ ÃÂ _floatdidf _floatdisf _fixunsdfsi
_fixunssfsi _fixunsdfdi _fixdfdi \
ÃÂ _fixunssfdi _fixsfdi
_fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \ ÃÂ _fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy
_eprintf \ ÃÂ _bb _shtab _clear_cache _trampoline
__main _exit _ctors _pure; \
do \ ÃÂ echo ${name}; \
ÃÂ
ÃÂ /home/davidt/gnu/src/sun/build-gcc/gcc/xgcc \ ÃÂ ÃÂ -B/home/davidt/gnu/src/sun/build-gcc/gcc/
\ ÃÂ ÃÂ
-B/home/davidt/gnu/bin/sun/i686-pc-linux-gnu/bin/ \ ÃÂ ÃÂ -I/home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include
-O2 ÃÂ \ ÃÂ ÃÂ -DCROSS_COMPILE -DIN_GCC
ÃÂ -DSVR4 ÃÂ -g -O2 -I./include ÃÂ \ ÃÂ ÃÂ -fPIC -g1 ÃÂ -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
\ ÃÂ ÃÂ -I. -I../../gcc-2.95.3/gcc
-I../../gcc-2.95.3/gcc/config \
ÃÂ ÃÂ
-I../../gcc-2.95.3/gcc/../include -c -DL${name} \ ÃÂ ÃÂ ../../gcc-2.95.3/gcc/libgcc2.c -o ${name}.o;
\ ÃÂ if [ $? -eq 0 ] ; then true; else
exit 1; fi; \ ÃÂ i686-pc-linux-gnu-ar rc tmplibgcc2.a
${name}.o; \ ÃÂ rm -f ${name}.o; \ done _muldi3 ../../gcc-2.95.3/gcc/libgcc2.c:41: stdlib.h: No such file or
directory ../../gcc-2.95.3/gcc/libgcc2.c:42: unistd.h:
No such file or directory
make[1]: *** [libgcc2.a] Error
1 make[1]: Leaving directory
`/home/davidt/gnu/src/sun/build-gcc/gcc' make: *** [all-gcc]
Error 2
I don't understand why stdlib.h &
unistd.h cannot be found. ÃÂ I need help, what am I doing
wrong? ÃÂ Any advice or URLs that would help me (the above script is from http://www.objsw.com/CrossGCC ) would be extremely
appreciated.
-- David Thompson david.thompson@efi.com
------ Want more information?
ÃÂ See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to
unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list