gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Compiler error: no reference to '__umodsi3'???

#3352 - ZhouChang - Sun Feb 23, 2003 11:44 am

Code:

D:\cygwin\home\gba\switch>make
arm-agb-elf-gcc -Wall   -c -o startup.o startup.c
arm-agb-elf-ld -T lnkscript  -o main.elf crt0.o startup.o arm.o util.o zxfont.o
-Map System.map
startup.o: In function `schedule':
startup.o(.text+0x2ac): undefined reference to `__umodsi3'
startup.o(.text+0x310): undefined reference to `__umodsi3'
make: *** [main.elf] Error 1


I use DevKitAdv tool chain in windows,here is error code:

Code:
   if ( ( ((time_ticks - ptask->itime) % ptask->period == 0 )
            || ptask->pexecute < ptask->execute ) &&
         (time_ticks > ptask->itime))
   {
      if ( (time_ticks - ptask->itime) % ptask->period == 0 )
         ptask->pexecute = 0;
      ptask->ready = 1;
   }
   else
   {
      ptask->ready = 0;   
   }

when remove these codes then there is no error.

#3354 - ZhouChang - Sun Feb 23, 2003 1:04 pm

Now, I have change Makefile , it works
Code:
AS = arm-agb-elf-as
LD = arm-agb-elf-ld
CC = arm-agb-elf-gcc
OBJDUMP = arm-agb-elf-objdump
CFLAGS = -Wall
ASFLAGS =
LDFLAGS = -nostartfiles -nostdlib -T lnkscript

OBJECTS = crt0.o startup.o arm.o util.o zxfont.o

all: t.gba

clean:
    rm -f *.o main.elf t.gba

t.gba: main.elf
    arm-agb-elf-objcopy -O binary main.elf t.gba

main.elf: ${OBJECTS}
    $(CC) $(LDFLAGS) -o main.elf ${OBJECTS} -lgcc
    $(OBJDUMP) -x main.elf > System.map

.c.o: $<
    $(CC) $(CFLAGS) -c -o $@ $<

.s.o: $<
    $(AS) $(ASFLAGS) -o $@ $<