GCC library linker problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCC library linker problems



I have spent more than three full days trying to debug a library linker problem.
  
  My project has custom start up code, and I must use -nodefaultlibs  -nostartfiles, in order to prevent conflicts with automatic startup  code.  
  
  Thus, I need to manually add libraries.  I am working within Eclipse and don't have the option of a custom makefile.
  
  If I try to use functions such as cos(x) or sprintf(), I get a huge  list of unresolved references.  I have added every library I am  aware of, without success.  Below is a dump.
  
  Any help would be greatly appreciated.
  
  
  Eric
  
  
  _______________________________
  
  
  **** Build of configuration Release for project X1_Core ****
  
  make -k pre-build main-build 
  arm-none-eabi-as ../x1_isr.S -o ../x1_isr.o
  ' '
  'Building target: X1_Core.o'
  'Invoking: GCC C Linker'
  arm-none-eabi-gcc -nostartfiles -nodefaultlibs ../boot.o ../x1_isr.o  -lc -Xlinker --script=../lpc2138.ld -Xlinker -lgcov -Xlinker -lstdc++  -Xlinker -lsupc++ -Xlinker -liberty -Xlinker -lnosys -Xlinker -lrdimon  -Xlinker -lrdpmon -Xlinker -lgcc -Xlinker -lc -Xlinker -lm -Xlinker -lg  -o"X1_Core.o"  ./MS5541.o ./UserSettings.o ./accel.o  ./bottomtimer.o ./bsp.o ./charge.o ./control.o ./deco.o ./decomenu.o  ./decoview.o ./dive.o ./flashmem.o ./globaldata.o ./graphics.o ./irda.o  ./isr.o ./mag.o ./main.o ./menu.o ./oled.o ./pc.o ./pressure.o  ./review.o ./rtc.o ./sleep.o ./spim_1.o ./spim_2.o ./taps.o ./thread.o  ./utilities.o   -lgcc -lc -lm -lg
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(vfprintf.o):  In function `_vfprintf_r':
  vfprintf.c:(.text+0xa34): undefined reference to `__aeabi_dcmplt'
  vfprintf.c:(.text+0xfac): undefined reference to `__aeabi_dcmpeq'
  vfprintf.c:(.text+0x114c): undefined reference to `__aeabi_dcmpeq'
  vfprintf.c:(.text+0x151c): undefined reference to `__aeabi_uldivmod'
  vfprintf.c:(.text+0x1538): undefined reference to `__aeabi_uldivmod'
  vfprintf.c:(.text+0x1c3c): undefined reference to `__aeabi_dcmpeq'
  vfprintf.c:(.text+0x202c): undefined reference to `__aeabi_dcmpeq'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(dtoa.o):  In function `_dtoa_r':
  dtoa.c:(.text+0x2a8): undefined reference to `__aeabi_dcmpeq'
  dtoa.c:(.text+0x354): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x360): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x36c): undefined reference to `__aeabi_dadd'
  dtoa.c:(.text+0x37c): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x388): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x39c): undefined reference to `__aeabi_dadd'
  dtoa.c:(.text+0x3a8): undefined reference to `__aeabi_d2iz'
  dtoa.c:(.text+0x3c0): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0x3fc): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0x544): undefined reference to `__aeabi_ui2d'
  dtoa.c:(.text+0x600): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x62c): undefined reference to `__aeabi_ddiv'
  dtoa.c:(.text+0x658): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0x6a8): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x6b8): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x6cc): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x6dc): undefined reference to `__aeabi_dadd'
  dtoa.c:(.text+0x73c): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x748): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x758): undefined reference to `__aeabi_dadd'
  dtoa.c:(.text+0x7a4): undefined reference to `__aeabi_ddiv'
  dtoa.c:(.text+0x7b0): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x7cc): undefined reference to `__aeabi_d2iz'
  dtoa.c:(.text+0x7d4): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x7e8): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x810): undefined reference to `__aeabi_dcmpgt'
  dtoa.c:(.text+0x830): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x844): undefined reference to `__aeabi_dcmpgt'
  dtoa.c:(.text+0x85c): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x868): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0x898): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x8b8): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x8c4): undefined reference to `__aeabi_d2iz'
  dtoa.c:(.text+0x8cc): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x8e0): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x8fc): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0x998): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x9ac): undefined reference to `__aeabi_dcmpeq'
  dtoa.c:(.text+0x9c8): undefined reference to `__aeabi_ddiv'
  dtoa.c:(.text+0x9cc): undefined reference to `__aeabi_d2iz'
  dtoa.c:(.text+0x9d4): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x9e8): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x9fc): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0xa24): undefined reference to `__aeabi_dadd'
  dtoa.c:(.text+0xa40): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0xa5c): undefined reference to `__aeabi_dcmpeq'
  dtoa.c:(.text+0xcd4): undefined reference to `__aeabi_ddiv'
  dtoa.c:(.text+0xd00): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0xd14): undefined reference to `__aeabi_dcmpgt'
  dtoa.c:(.text+0xd38): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0xe74): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0xe80): undefined reference to `__aeabi_dcmpge'
  dtoa.c:(.text+0x1000): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x1014): undefined reference to `__aeabi_dcmpeq'
  dtoa.c:(.text+0x12bc): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x12d0): undefined reference to `__aeabi_d2iz'
  dtoa.c:(.text+0x12d8): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x12ec): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x1324): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x1330): undefined reference to `__aeabi_d2iz'
  dtoa.c:(.text+0x1338): undefined reference to `__aeabi_i2d'
  dtoa.c:(.text+0x134c): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x138c): undefined reference to `__aeabi_dadd'
  dtoa.c:(.text+0x1398): undefined reference to `__aeabi_dcmplt'
  dtoa.c:(.text+0x13b8): undefined reference to `__aeabi_dsub'
  dtoa.c:(.text+0x13c4): undefined reference to `__aeabi_dcmpgt'
  dtoa.c:(.text+0x141c): undefined reference to `__aeabi_dmul'
  dtoa.c:(.text+0x1454): undefined reference to `__aeabi_dmul'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(makebuf.o):  In function `__smakebuf':
  makebuf.c:(.text+0xe8): undefined reference to `isatty'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(mprec.o):  In function `_ratio':
  mprec.c:(.text+0x2f8): undefined reference to `__aeabi_ddiv'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(mprec.o):  In function `_mprec_log10':
  mprec.c:(.text+0x348): undefined reference to `__aeabi_dmul'
  mprec.c:(.text+0x360): undefined reference to `__aeabi_dmul'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(sbrkr.o):  In function `_sbrk_r':
  sbrkr.c:(.text+0x1c): undefined reference to `_sbrk'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(writer.o):  In function `_write_r':
  writer.c:(.text+0x24): undefined reference to `_write'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(closer.o):  In function `_close_r':
  closer.c:(.text+0x1c): undefined reference to `_close'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(fstatr.o):  In function `_fstat_r':
  fstatr.c:(.text+0x20): undefined reference to `_fstat'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(lseekr.o):  In function `_lseek_r':
  lseekr.c:(.text+0x24): undefined reference to `_lseek'
  c:/program files/codesourcery/sourcery  g++/bin/../lib/gcc/arm-none-eabi/4.1.1/../../../../arm-none-eabi/lib\libc.a(readr.o):  In function `_read_r':
  readr.c:(.text+0x24): undefined reference to `_read'
  collect2: ld returned 1 exit status
  make: *** [X1_Core.o] Error 1
  make: Target `main-build' not remade because of errors.
  Build complete for project X1_Core