[gccsdk] OSLib cross-build fail

Theo Markettos theo at markettos.org.uk
Tue Nov 29 16:10:39 PST 2011


On Tue, Nov 29, 2011 at 03:11:53AM +0000, John Tytgat wrote:
> When you specify -mlibscl (i.e. use the SharedCLibrary) or -mmodule, gcc
> will use a hardfloat ABI (as that's what SharedClibrary expects, the floating
> point parameters are passed via the floating point registers). The trouble
> is that this fact is also stored in all object files produced and also
> checked by the binutils linker that all object files used are using the
> same or compatible ABI (in fact, this is a good thing but in this case
> unnecessary, read on).  Moreover when a conflict in hardfloat vs
> softfloat is detected the linker error message is a bit confusing/wrong
> concerning its object files where it detects a conflect.
> 
> In your case, I'm more or less sure your just built OSLib library is
> softfloat and upsets the linker.  So you need to build OSLib with
> ELFOBJECTTYPE=HARDFPU or even, as you're building a module
> ELFOBJECTTYPE=MODULE.

Hmm... I updated gccsdk to svn rev 5453 and reduced my test case to this:

hello.c:
int main(void)
{
  int i;
  return 3/i;
}

/local/scratch/atm26/riscos/gccsdk/env/arm-unknown-riscos-gcc -mmodule
-mlibscl -o hello hello.c 

If I remove the -mmodule -mlibscl, it compiles fine.  With it there, it compiles
about mismatched hard FP functions in libgcc, such as:
_udivsi3.o
_umodsi3.o
_arm_addsubdf3.o
_arm_fixdfsi.o
unwind-arm.o
pr-support.o
_clzsi2.o
crtend.o
crtn.o

(My pathnames are huge, so rather annoying to paste the errors here)

Then goes on to complain about undefined references to SCL functions
(eg _kernel_entermodue, TrapHandler, _clib_initialise, _stub_kallocExtendsWS,
_main)

and finally keels over with:

/local/scratch/atm26/riscos/gccsdk/cross/lib/gcc/arm-unknown-riscos/4.6.3/../../../../arm-unknown-riscos/bin/ld:
/BFD (GCCSDK GCC 4.6.3 Release 1 Development) 2.22 assertion fail
//local/scratch/atm26/riscos/gccsdk/gcc4/srcdir/binutils/bfd/elf32-arm.c:8350
/local/scratch/atm26/riscos/gccsdk/cross/lib/gcc/arm-unknown-riscos/4.6.3/../../../../arm-unknown-riscos/bin/ld:
/BFD (GCCSDK GCC 4.6.3 Release 1 Development) 2.22 assertion fail
//local/scratch/atm26/riscos/gccsdk/gcc4/srcdir/binutils/bfd/elf32-arm.c:8350
/local/scratch/atm26/riscos/gccsdk/cross/lib/gcc/arm-unknown-riscos/4.6.3/../../../../arm-unknown-riscos/bin/ld:
/BFD (GCCSDK GCC 4.6.3 Release 1 Development) 2.22 assertion fail
//local/scratch/atm26/riscos/gccsdk/gcc4/srcdir/binutils/bfd/elf32-arm.c:11351
collect2: ld returned 1 exit status


Has module support been broken recently?

Thanks
Theo




More information about the gcc mailing list