Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Linking Error....iButton Test program Robert Adsett's Port

2006-04-10 by Robert Adsett

At 12:39 AM 4/10/2006 +0000, ocnek1 wrote:
>Ok...everything was going ok then I got this error...hehe.  I think
>I'm finding every problem that someone can encounter here.
>
>Linking: rs232_stdio.elf
>arm-elf-gcc  -mcpu=arm7tdmi  -I. -g -DROM_RUN  -O0 -Wall
>-Wstrict-prototypes -Wcast-align -Wcast-qual -Wimplicit
>-Wmissing-prototypes  -Wnested-externs -Wpointer-arith -Wswitch
>-Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wunused
>-Wa,-adhlns=build/crt0.o  -std=gnu99  -MD -MP -MF
>.dep/rs232_stdio.elf.d build/crt0.o    rs232_stdio.o  --output
>rs232_stdio.elf -nostartfiles -Wl,-Map=rs232_stdio.map,--cref  -lc
>-lgcc  -lnewlib-lpc -lm -lownet-lpc -Tbuild/LPC2106-ROM.ld
>c:/winarm/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/lib\libnewlib-lpc.a(sys_time.o):
>In function `counts_to_us':sys_time.c:(.text+0x30): undefined
>reference to `__udivdi3'
>collect2: ld returned 1 exit status
>make.exe: *** [rs232_stdio.elf] Error 1

<snip>

>Is the problem trying to do the long long math???

Sort of,
The problem is it can't find __udivdi3 because it has already linked in the 
library containing it before it finds out that newlib-lpc needs it.  It's a 
consequence of ld being a single pass linker.  Therefore the library 
containing the basic c primitives should be the last on the link line. -lc 
should probably be last -lm before it, -lnewlib-lpc before it and -lgcc 
before it (it's possible -lgcc will need to be both before and after 
-lnewlib-lpc) -lownet-lpc should be first in the list.

Getting the order right can sometimes be a little troublesome.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.