On Tue, 2006-01-03 at 15:52, Karel Gardas wrote:
> On Tue, 3 Jan 2006, Richard Earnshaw wrote:
> 
> > On Tue, 2006-01-03 at 15:38, Karel Gardas wrote:
> >
> >> OK, if I understand you well, then I should not use -msoft-float for both:
> >> compiling of eCos lib and then for compiling my eCos-based app. The
> >> problem is that this is not right way how to workaround this issue. I've
> >> checked that I'm not using -msoft-float neither for building eCos lib nor
> >> for building eCos-based app. I've saved typescript of `make' so I'm sure
> >> build does not use -msoft-float anywhere and the issue is still the same.
> >>
> >> FYI: Options used for eCos lib build are:
> >> -finline-limit=7000 -Wa,-mfpu=softfpa -mbig-endian -mcpu=xscale -Wall
> >> -Wpointer-arith -Wstrict-prototypes -Winline -Wundef  -g -O2
> >> -ffunction-sections -fdata-sections  -fno-exceptions  -mapcs-frame
> >
> > Try taking -Wa,-mfpu=softfpa out as well.  That will probably have the
> > same adverse effect on the object files generated.
> 
> OK, I've removed this and got this one now:
> 
> silence:~/usr/local/xscale-ecos-default/ixdp425_install/examples$ 
> arm-elf-gcc -mbig-endian -O2 -g hello.c -o hello.xg -I../include -L../lib 
> -nostdlib -Ttarget.ld
> /home/karel/usr/local/arm-elf1/lib/gcc/arm-elf/4.0.1/../../../../arm-elf/bin/ld:
>  
> ERROR: /tmp/ccKN8dgp.o uses FPA instructions, whereas hello.xg does not
> /home/karel/usr/local/arm-elf1/lib/gcc/arm-elf/4.0.1/../../../../arm-elf/bin/ld:
>  
> failed to merge target specific data of file /tmp/ccKN8dgp.o
> /home/karel/usr/local/arm-elf1/lib/gcc/arm-elf/4.0.1/../../../../arm-elf/bin/ld:
>  
> ERROR: 
> /home/karel/usr/local/arm-elf1/lib/gcc/arm-elf/4.0.1/be/libgcc.a(_udivsi3.o) 
> uses FPA instructions, whereas hello.xg does not
> ....
> 
> Anyway, I've now compared fpu and common libgcc and found that really fpu 
> (which should be hard-float) is different from the common lib in be 
> subdirectory (I'm talking about gcc/be/libgcc.a and gcc/be/fpu/libgcc.a), 
> so my assumption about building hard-float libgcc by default is not true 
> neither.
> 
> Do you have any idea how to proceed with this?

Ug, this would appear to be a bundle of different options plus a
build-process that ends up with everything conflicting[1] with itself...
;-(

First of all, you can't in general just copy in the old version of
t-arm-elf into a later version of GCC and expect it to work correctly. 
Compare the gcc-4.0.x version against the sample one from the website
and then uncomment the relevant bits to suit your needs (this is for the
multilibs stuff).  You probably won't need everything, but if you
closely mimic what's been done before you should have fewer problems. 
The options are generally grouped, so if you uncomment one option, make
sure you uncomment the entire group.

Next, I suggest you add --with-cpu=xscale when configuring GCC.  You can
then drop the -mcpu=xscale when compiling (this should also give you
better libraries for your system).  However, beware that you libraries
will now only run on ARMv5 or later processors.

R.

[1] If you want the gory details, then I think they are as follows:
- With no CPU specified the assembler assumes -msoft-fpa as a default,
but it incorrectly marks the objects as being hard-fpa
- With -mcpu=xscale the assembler defaults to -msoft-vfp and correctly
marks the objects as such.
- There's then no way to switch back to 'soft-fpa, but with the hard-fpa
marking used by the default configuration.


Reply via email to