Can't build arm-elf cross compiler

William A. Gatliff bgat@saturn.billgatliff.com
Wed Oct 31 07:09:00 GMT 2001


Hi!


> <Environment>
>  Cygwin         : 1.3.2
>  GCC            : gcc-core-3.0.1
>                   gcc-g++-3.0.1
>  BINUTILS       : binutils-2.11.2
>  NEWLIB         : newlib-1.9.0
>  HOST           : Windows98 machine  (i586-pc-cygwin)
>  TARGET         : ARM7(arm-elf)

I haven't done anything with gcc-3.x.  Your mileage may vary.  If you
can, try the 2.95.3 or later gcc first.


>   $ export PATH=$PATH:/tools/arm-elf/bin


This is why my scripts set up the path and prefix the way they do.
Your path is wrong, at least according to the prefix you supplied for
binutils.  Do this:

export PREFIX=/tools
export PATH=$PATH:${PREFIX}/bin
../binutils-2.10.1/configure --prefix=$PREFIX ...



> STEP2
>   $ ../binutils-2.10.1/configure --target=arm-elf \
>                                  --prefix=/tools 2>&1 | tee configure.log
>   $ make all install 2>&1 | tee make.log
> 
>  These succeeded.

... then you should see arm-elf-ar in /tools/bin, not /tools/arm-elf/bin.

> STEP3
>   $ cd /src/gcc-3.0.1
>   $ ln -s /src/newlib-1.9.0/newlib
> 
>  Is this link necessary?
>  Is "libgloss" also necessary?
>  Or, is neither necessary?

Hmmm, looks like you're using a really old copy of my "getting started
with GNU" series.  Try the arm-elf tutorial at
http://billgatliff.com/articles .


> STEP4
>   Before executing "gcc-configure", I added the definition to
>   "/src/gcc-3.0.1/gcc/config/arm elf.h" as follows.
>   Because not call "main()".
> 
>  Add:
>   #define HAS_INIT_SECTION
> 
>   to beginning of elf.h file.
> 
> 
>   Is this correct?
>   Or,do not change it?

I don't know anything about this.

>   # Additional target-dependent options for compiling libgcc2.a.
>     TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc

I think you only need this for arm-linux targets.

>   $ make all-gcc install-gcc 2>&1 | tee make.log
> 
>  The following errors occur at "gcc-make".
>  "arm-elf-ar:not found"

That's because arm-elf-ar is in /tools/bin, not /tools/arm-elf/bin.


> libgcc.a(unwind-dw2-fde.o) : In function `size_of_encoded_value':
> unwind-dw2-fde.o(.text+0x5c) : undefined reference to `abort'

Looks like gcc didn't link in your libc.  Try doing the build process
over, with the above corrections, and see how it goes.


b.g.
-- 
Bill Gatliff
bgat@billgatliff.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