On Wed, 18 Mar 2009 10:00:27 +0100, "Vincent R." <forumer@xxxxxxxxxxxxxxx> wrote: > On Wed, 11 Mar 2009 00:57:53 +0100, "Vincent R." <forumer@xxxxxxxxxxxxxxx> > wrote: >> On Tue, 10 Mar 2009 23:29:46 +0100, "Vincent R." > <forumer@xxxxxxxxxxxxxxx> >> wrote: >>> On Tue, 10 Mar 2009 23:55:02 +0200, Kai Ruottu <kai.ruottu@xxxxxxxxxxx> >>> wrote: >>>> Kai Ruottu wrote: >>>> >>>>> Vincent R. wrote: >>>>>> Hi, >>>>>> >>>>>> When compiling the following code with a gcc 4.4 cross-compiler >>>>>> targetting >>>>>> arm wince platform I get a problem with undefined reference >> __floatdidf >>>>>> : >>>>> >>>>> This should mean a conversion routine from long int to double float >>>>> and this routine is normally in libgcc... So a search with 'nm' >>>>> would tell if it is there or not. >>>> >>>> A quick look in 'gcc/config/arm' told that the 'lib1funcs.asm' should >>>> #include the 'ieee754-*.S' which has this routine. But there are two >>>> conditions for the inclusion : >>>> >>>> #ifndef __symbian__ >>>> #ifndef __ARM_ARCH_6M__ >>>> #include "ieee754-df.S" >>>> #include "ieee754-sf.S" >>>> #include "bpabi.S" >>>> #else /* __ARM_ARCH_6M__ */ >>>> #include "bpabi-v6m.S" >>>> #endif /* __ARM_ARCH_6M__ */ >>>> #endif /* !__symbian__ */ >>>> >>>> Whether the WinCE target defines something like these will be left you >>>> as a homework... >>> >>> When using nm with gcc-4.4: >>> >>> $ arm-mingw32ce-nm libgcc.a | grep float >>> _floatdidf.o: >>> _floatdisf.o: >>> U __floatunsidf >>> U __floatunsidf >>> _floatdixf.o: >>> _floatditf.o: >>> _floatundisf.o: >>> 00000000 T __floatundisf >>> U __floatunsidf >>> _floatundidf.o: >>> 00000000 T __floatundidf >>> U __floatunsidf >>> _floatundixf.o: >>> _floatunditf.o: >>> 0000000c T __floatsisf >>> 0000000c T __floatunsisf >>> 0000000c T __floatsidf >>> 0000000c T __floatunsidf >>> >>> with an old working version (4.1.2): >>> >>> 0000038c T __floatdidf >>> 00000310 T __floatsidf >>> 00000378 T __floatundidf >>> 000002ec T __floatunsidf >>> 00000200 T __floatdisf >>> 000001d0 T __floatsisf >>> 000001f0 T __floatundisf >>> 000001c8 T __floatunsisf >>> _floatdidf.o: >>> _floatdisf.o: >>> U __floatsidf >>> U __floatsidf >>> _floatdixf.o: >>> _floatditf.o: >>> 00000000 T __floatsisf >>> 00000000 T __floatunsisf >>> 00000000 T __floatsidf >>> 00000000 T __floatunsidf >>> >>> >>> and since __symbian__ nor __ARM_ARCH_6M__ are defined I suppose >> ieee754-*.S >>> are included. >>> >>> From what I see with old version __floatxxx were defined bur not with > new >>> compiler. >>> >> I found why it's because of the following test : >> >> #ifdef L_arm_addsubdf3 >> ... >> #endif >> >> Now I need to find why L_arm_addsubdf3 is defined. > So I am still stuck with this missing symbol. What I don't understand is the fact that __floatundidf is available but not __floatdidf. If I look in gcc/config/arm/t-wince-pe here is what is declared for my target: LIB1ASMSRC = arm/lib1funcs.asm LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2 \ _bb_init_func _lshrdi3 _ashrdi3 _ashldi3 \ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ _fixsfsi _fixunssfsi _floatdidf _floatdisf \ _arm_fixunsdfsi and I can see that _floatdidf is declared but is not available in libgcc while _floatundidf is not and is available. Does it mean I need to remove _floatdidf _floatdisf from the list ? Maybe the problem comes from the patch I am applying against vanilla gcc : Index: gcc/config/arm/lib1funcs.asm =================================================================== --- gcc/config/arm/lib1funcs.asm (révision 144104) +++ gcc/config/arm/lib1funcs.asm (copie de travail) @@ -52,22 +52,22 @@ #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) #ifdef __ELF__ -#ifdef __thumb__ -#define __PLT__ /* Not supported in Thumb assembler (for now). */ +# ifdef __thumb__ +# define __PLT__ /* Not supported in Thumb assembler (for now). */ +# else +# define __PLT__ (PLT) +# endif +# define TYPE(x) .type SYM(x),function +# define SIZE(x) .size SYM(x), . - SYM(x) +# define LSYM(x) .x #elif defined __vxworks && !defined __PIC__ #define __PLT__ /* Not supported by the kernel loader. */ #else -#define __PLT__ (PLT) +# define __PLT__ +# define TYPE(x) .def SYM(x); .scl 2; .type 32; .endef +# define SIZE(x) +# define LSYM(x) CONCAT1 (__LOCAL_LABEL_PREFIX__, x) #endif -#define TYPE(x) .type SYM(x),function -#define SIZE(x) .size SYM(x), . - SYM(x) -#define LSYM(x) .x -#else -#define __PLT__ -#define TYPE(x) -#define SIZE(x) -#define LSYM(x) x -#endif /* Function end macros. Variants for interworking. */ @@ -1253,7 +1253,7 @@ 2: adr r2, 1f ldrb r0, [r2, r0] add r0, r0, r1 - bx lr + RET .align 2 1: .byte 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 Index: gcc/config/arm/t-wince-pe =================================================================== --- gcc/config/arm/t-wince-pe (révision 144104) +++ gcc/config/arm/t-wince-pe (copie de travail) @@ -1,6 +1,26 @@ LIB1ASMSRC = arm/lib1funcs.asm -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2 +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2 \ + _bb_init_func _lshrdi3 _ashrdi3 _ashldi3 \ + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ + _fixsfsi _fixunssfsi _floatdidf _floatdisf \ + _arm_fixunsdfsi + +# For most CPUs we have an assembly soft-float implementations. +# However this is not true for ARMv6M. Here we want to use the soft-fp C +# implementation. The soft-fp code is only build for ARMv6M. This pulls +# in the asm implementation for other CPUs. +#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \ +# _call_via_rX _interwork_call_via_rX \ +# _lshrdi3 _ashrdi3 _ashldi3 \ +# _arm_negdf2 _arm_addsubdf3 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ +# _arm_fixdfsi _arm_fixunsdfsi \ +# _arm_truncdfsf2 _arm_negsf2 _arm_addsubsf3 _arm_muldivsf3 \ +# _arm_cmpsf2 _arm_unordsf2 _arm_fixsfsi _arm_fixunssfsi \ +# _arm_floatdidf _arm_floatdisf _arm_floatundidf _arm_floatundisf \ +# _clzsi2 _clzdi2 + # We want fine grained libraries, so use the new code to build the # floating point emulation libraries. FPBIT = fp-bit.c @@ -20,12 +40,34 @@ echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c +pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/arm/pe.c -MULTILIB_OPTIONS = mhard-float -MULTILIB_DIRNAMES = fpu +pe-cxx.o: $(srcdir)/config/arm/pe-cxx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/arm/pe-cxx.c + +pe-stubs.o: $(srcdir)/config/arm/pe-stubs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/arm/pe-stubs.c + +#hack! using i386 file directly... +msformat-c.o: $(srcdir)/config/i386/msformat-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/msformat-c.c + +MULTILIB_OPTIONS = +MULTILIB_DIRNAMES = + # Note - Thumb multilib omitted because Thumb support for # arm-wince-pe target does not appear to be working in binutils # yet... @@ -34,4 +76,59 @@ LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -TARGET_LIBGCC2_CFLAGS = +# Currently there is a bug somewhere in GCC's alias analysis +# or scheduling code that is breaking _fpmul_parts in fp-bit.c. +# Disabling function inlining is a workaround for this problem. +TARGET_LIBGCC2_CFLAGS = -fno-inline + +STMP_FIXINC=stmp-fixinc +