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]

RE: Please help get me started...


>-----Original Message-----
>From: Robert Lewko [mailto:rob@wirelessnetworksinc.com]
>Sent: 06 April 2001 00:39

>First, let me see if I am on the right track.  What I eventually want is
>a c/c++ compiler that is hosted on i386-linux and generates code for
>arm-linux-elf and links against the uC-libc library.  This library
>should include the linux-threads package.  Do I build a cross compiler
>first with newlib then use that to compile uC-libc or can I start
>building the compiler wiith uC-libc.

  Well, I'd say neither really.  What you are doing constitutes porting
gcc to a new target architecture - not arm-linux-elf, but arm-uclinux-elf.
The abi and implementation details of the C library (which after all is
the interface between the C application environment and the OS) are one
of the defining characteristics of the port (the other main ones being
CPU and object file format).

  You might be able to bodge something together in this way and end up with
a working compiler, or you might not...

  I think the best approach would be to point at the headers at gcc config
time by using the --with-headers=/path/to/uclinux/libc/headers.  Then
you may run into bugs further on during the compilation, if you encounter
non-standard problems in the uclinux header files.  These should be fixed
by adding patches to inclhack.def in the fixincs directory.

  For this to work, you would then do a "make LANGUAGES=c" to build the
raw C compiler without worrying about libs or startup files.  Then do
"make LANGUAGES=c install" to install what you've got so far.  At that
point, you can use this raw compiler to build the uclinux c library from
source.  That will supply you with your libc, libm and crt startup files.

  The final step would be to build and install the full C/C++ compiler
by doing "make LANGUAGES='c c++' all install"

>What I have done so far is:
>
>1) run one-tree-1.6.sh in ~/crossgcc
>
>2) copy the header files from
>~crossgcc/newlib-1.9.0/newlib/libc/include to
>/usr/local/arm-linux/include
>
>3) make ~/crossgcc/build
>
>4) enter this directory and issue the command:
>
>../src/configure --target=arm-linux --with-newlib
>
>5) make all
>
>This stops with an error as follows:
>
>cp ../../src/gcc/config/arm/lib1funcs.asm libgcc1.S
>for name in _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx; \
>do \
>  echo ${name}; \
>  /home/rob/crosscompiler/build/gcc/xgcc
>-B/home/rob/crosscompiler/build/gcc/ -B/usr/local/arm-linux/bin/
>-I/usr/local/arm-linux/include -O2  -DCROSS_COMPILE -DIN_GCC     -g -O2
>-I./include  -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT
>-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc  -I.
>-I../../src/gcc -I../../src/gcc/config -I../../src/gcc/../include -c
>-DL${name} libgcc1.S; \
>  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>  mv libgcc1.o ${name}.o; \
>  /home/rob/crosscompiler/build/binutils/ar rc tmplibgcc1.a 
>${name}.o; \
>
>  rm -f ${name}.o; \
>done
>_udivsi3
>_divsi3
>_umodsi3
>_modsi3
>_dvmd_lnx
>libgcc1.S:438: asm/unistd.h: No such file or directory
>make[1]: *** [libgcc1-asm.a] Error 1

  You probably need to create a soft link in your Gcc build directory,
/home/rob/crosscompiler/build/gcc/, called 'newlib' and pointing to the
newlib directory at '../newlib'.  But you even more probably don't want
to be using newlib at all.

>I have noticed that there are much newer compilers, ie.
>gcc-2.95.3.tar.gz.  Should I use this one?  If not what have I done
>wrong?

  Yes, it would definitely be worth your while using a more recent
gcc.  2.95.3 would be a good choice to start from since 3.0 is in a bit
of a tricky situation at the moment.  There's no need to stick religiously
to the version numbers suggested in the CrossGCC FAQ: they were just the
best, most up-to-date versions at the time, but there are more recent
releases available these days.

       DaveK
-- 
"screams erupted at a Seattle hotel where Microsoft founder Bill Gates was
addressing an education and technology conference. He was whisked away as
his audience bolted for the exits. Some audience members were knocked down
by others trying to get out." 
       -- CNN 2/28/01 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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


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