need help with gcc 4.1.0 crosscompiler for arm

Niklaus niklaus@gmail.com
Fri Apr 14 04:53:00 GMT 2006


On 4/14/06, marty fouts <mf.danger@gmail.com> wrote:
> On 4/13/06, Niklaus <niklaus@gmail.com> wrote
> > How did you try to build gcc-4.1. Can you give the whole build command.
> > Please provide more details so that we can help you out.
> >
>
> I've attached a shar file with all the details. Unpack it into an
> empty directory,  cd to that directory, and try 'sh ./makeit' This
> will fetch binutils and gcc; configure and make binutils and gcc; and
> then attempt to use arm-elf-gcc to compile a tiny c program that
> demonstrates the problem. (Obviously, if you already have binutils and
> gcc tgz files, you can comment out the wgets before running the script
> and replace them with references to your local copies.)
>
> ----- demo.c
> int _start()
> {
>         double f = 1.23;
>         return f;
> }
> -----
>
>
> Basically, if I tell arm-elf-gcc which arm processor I'm using, it
> recognizes that the processor has no floating point, so arm-elf-ld
> fails, as it should, with the messages:
>
> sponge:sf 500:arm/bin/arm-elf-gcc -mthumb-interwork -msoft-float
> -mcpu=arm926ej-s -c demo.c
> sponge:sf 501: arm/bin/arm-elf-ld -o demo.elf demo.o
> arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a
>
> arm/bin/arm-elf-ld: ERROR:
> arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a(_fixdfsi.o) uses FPA
> instructions, whereas demo.elf does not
> arm/bin/arm-elf-ld: failed to merge target specific data of file
> arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a(_fixdfsi.o)
>
>
> if I remove '-mcpu=arm926ej-s' from the compile, then the ld will
> work, but i'll end up with floating point instructions on an arm
> processor that has no fp.
>
> The configuration and make steps from the attached script are:
>
> mkdir binutils-build
> cd binutils-build
> ../binutils-2.16.1/configure --prefix=$BASE/arm --target=arm-elf
> --enable-interwork --enable-multilib --with-float=soft
> make all && make install
> cd ..
>

pro@deb:~/armenv/bin$ ./arm-elf-gcc -v
Using built-in specs.
Target: arm-elf
Configured with: /home/pro/gcc-4.1.0/configure --target=arm-elf
--prefix=/home/pro/armenv/ --with-float=soft --with-newlib
--without-headers --enable-languages=c --disable-nls --disable-shared
--disable-thread
Thread model: single
gcc version 4.1.0
pro@deb:~/armenv/bin$

pro@deb:~/armenv/bin$ cat foo.c
int _start()
{
               double f = 1.23;
                      return f;
}


pro@deb:~/armenv/bin$ ./arm-elf-gcc -c foo.c
pro@deb:~/armenv/bin$ file foo.o
foo.o: ELF 32-bit LSB relocatable, ARM, version 1 (ARM), not stripped
pro@deb:~/armenv/bin$ ./arm-elf-ld -o demo.elf foo.o
../lib/gcc/arm-elf/4.1.0/libgcc.a

i usually build binutils first. Then export the PATH for binutils
prefix/bin. then build gcc bootstrap (stage1).

Does this help you ? If not ask for more. You can add newlib or glibc
after gcc bootstrap.

> mkdir gcc-build
> cd gcc-build
> ../gcc-4.1.0/configure --prefix=$BASE/arm --target=arm-elf
> --enable-languages=c --with-float=soft --enable-interwork
>
> make all-gcc && make install-gcc
> cd ..
>
> The problem seems to be that I'm not passing the right arguments to
> gcc-4.1.0/configure to cause it to not build libgcc.a with floating
> point.
>
> All help is appreciated.
>
> If the shar file attachment doesn't make it through, it can be picked up via
> wget http://www.fogey.com/bug.shar
>
> or
>
> wget http://www.fogey.com/bug.tgz
>
> Marty
>
>
>



More information about the Gcc-help mailing list