ARM bug in newlib?

Joe Pencak
Wed Feb 4 17:04:00 GMT 2004

I have built newlib-1.12.0 to work with a GCC ARM cross compiler. Newlib
was configured as follows on a Pentium II running

>../newlib-1.12.0/configure \
>   --enable-languages=c \
>   --target=arm-elf \
>   --program-prefix=arm- \
>   --prefix=/usr/local/arm

When I use function atoi() in my code, I get the following linker

>\usr\local\arm\arm-elf\lib/libc.a(strtol.o)(.text+0x90): In function
>../../../../../newlib-1.12.0/newlib/libc/stdlib/strtol.c:186: undefined
>e to `__umodsi3'

>12.0/newlib/libc/stdlib/strtol.c:187: undefined reference to

The code was linked as follows:

>arm-ld -d -b elf32-littlearm -e __start -EL -static -nostdlib
-nostartfiles -L\u
>sr\local\arm\arm-elf\lib  -T linker-arm-gcc.lcf  _vectors.o
_startup.o  exceptions
>.o  main.o -lc -lm -Map -o a.elf

References to __umodsi3 and __udivsi3 appear in divsi3.c in
machine/h8500 and machine/w65, but not in machine/arm.
Apparently, when newlib is built for ARM, there is no divsi3.c with the
necessary references. A bug?
I've built newlib like this for the PowerPC and had no such problem.


More information about the Newlib mailing list