2010-10-14 23:32:29     missing __modsi3

Document created by Aaronwu Employee on Oct 16, 2013
Version 1Show Document
  • View in full screen mode

2010-10-14 23:32:29     missing __modsi3

Mark Noonchester (NEW ZEALAND)

Message: 94529   

 

I have an old app that used to compile but now seems to be broken.

 

After a make clean I get the following error

 

bfin-elf-gcc -I../include -g -O2 -Wall -fomit-frame-pointer -fno-builtin-printf -fno-builtin-puts -fno-builtin-strchr -fno-builtin-strcpy -fno-builtin-strlen -fno-builtin-strdup -fno-builtin-memset -fno-builtin-memcpy -fno-builtin-isdigit -fno-builtin-cos -fno-builtin-sin -fno-builtin-tan -fno-builtin-acos -fno-builtin-asin -fno-builtin-atan -D__ADSPBF537__ -D__ADSPLPBLACKFIN__ -DSURVEYOR_HOST -mfast-fp   -c -o picoc/platform_surveyor.o picoc/platform_surveyor.c

bfin-elf-gcc -x assembler-with-cpp -D__ADSPBF537__ -D__ADSPLPBLACKFIN__ -DSURVEYOR_HOST -I../include -c -o r8x8dct.o r8x8dct.asm

bfin-elf-gcc -x assembler-with-cpp -D__ADSPBF537__ -D__ADSPLPBLACKFIN__ -DSURVEYOR_HOST -I../include -c -o math.o math.asm

bfin-elf-gcc -x assembler-with-cpp -D__ADSPBF537__ -D__ADSPLPBLACKFIN__ -DSURVEYOR_HOST -I../include -c -o setjmp.o setjmp.asm

bfin-elf-gcc -x assembler-with-cpp -D__ADSPBF537__ -D__ADSPLPBLACKFIN__ -DSURVEYOR_HOST -I../include -c -o motionvect.o motionvect.asm

bfin-elf-ld -T srv1.x -Map srv1.map -O binary -o srv1.bin init.o main.o srv.o uart.o camera.o jpeg.o i2c.o stm_m25p32.o httpd.o xmodem.o colors.o edit.o malloc.o string.o printf.o myfunc.o neural.o gps.o sdcard.o picoc/picoc.o picoc/table.o picoc/lex.o picoc/parse.o picoc/expression.o picoc/heap.o picoc/type.o picoc/variable.o picoc/clibrary.o picoc/library_surveyor.o picoc/platform.o picoc/platform_surveyor.o r8x8dct.o math.o setjmp.o motionvect.o  -lbffastfp

srv.o: In function `rand':

/home/nooney/blackfin_sources/blackfin/srv/srv.c:2343: undefined reference to `__modsi3'

printf.o: In function `dbl2stri':

/home/nooney/blackfin_sources/blackfin/srv/printf.c:124: undefined reference to `__modsi3'

/home/nooney/blackfin_sources/blackfin/srv/printf.c:144: undefined reference to `__modsi3'

make: *** [srv1.bin] Error 1

 

 

Has something changed in the tool chain that could cause this?

 

Mark

QuoteReplyEditDelete

 

 

2010-10-14 23:46:59     Re: missing __modsi3

Mike Frysinger (UNITED STATES)

Message: 94530   

 

not a toolchain bug ... you need to link in the gcc math library: -lgcc

QuoteReplyEditDelete

 

 

2010-10-15 01:15:36     Re: missing __modsi3

Mark Noonchester (NEW ZEALAND)

Message: 94535   

 

I assume I need to modify the make file to include lgcc.

 

I can't find a lgcc file I have noticed there seems to be some problem with this file on 64 bit plateforms.

 

Could this be the problem?

QuoteReplyEditDelete

 

 

2010-10-15 01:21:38     Re: missing __modsi3

Mike Frysinger (UNITED STATES)

Message: 94536   

 

i dont know what you mean.  libgcc is included in the toolchain.

QuoteReplyEditDelete

 

 

2010-10-15 01:36:26     Re: missing __modsi3

Mark Noonchester (NEW ZEALAND)

Message: 94538   

 

sorry Mike I was looking for lgcc.

 

Do I need to change the make file for the progect I am working on to include libgcc

 

Makefile

QuoteReplyEditDelete

 

 

2010-10-15 01:46:03     Re: missing __modsi3

Mike Frysinger (UNITED STATES)

Message: 94539   

 

it's either change the Makefile or continue with a linking error ... doesnt seem like much of a choice

 

instead of calling the linker directly, invoke the compiler driver.  i.e. use `bfin-elf-gcc` and -nostdlib.

QuoteReplyEditDelete

 

 

2010-10-16 23:57:10     Re: missing __modsi3

Mark Noonchester (NEW ZEALAND)

Message: 94602   

 

Hi

 

The problem appears to be in mfast-fp has this changed to exclude the modsi3 function sometime after 2008.

 

I hate looking at someone else's old code but it appears that excluded lots of stuff and included mfast-fp to save space.

 

Mark

QuoteReplyEditDelete

 

 

2010-10-17 00:02:05     Re: missing __modsi3

Mike Frysinger (UNITED STATES)

Message: 94605   

 

again, this is not a toolchain bug.  gcc may choose to leverage its external math funcs in libgcc at any time.

QuoteReplyEditDelete

 

 

2010-10-17 00:04:56     Re: missing __modsi3

Mark Noonchester (NEW ZEALAND)

Message: 94606   

 

Thanks Mike

 

i.e. someone hacked the system and then the system changed and the hack broke.

 

Recomendation remove the hack.

 

Now to figure out how to change the linker config without breaking other stuff.

 

Mark

QuoteReplyEditDelete

 

 

2010-10-17 00:11:05     Re: missing __modsi3

Mike Frysinger (UNITED STATES)

Message: 94607   

 

if you dont want to fix the link to use the compiler driver, you could probably extend the current direct linker invocation by adding to the end:

`bfin-elf-gcc -print-libgcc-file-name`

Attachments

Outcomes