> Hello, >> I am compiling C code containing division of two type int variables, stored> to a type int. Compilation goes well, but linking produces: > > obj/tcp_in.o(.text+0x2064): In function `tcp_receive': > src/lwip-1.1.0/src/core/tcp_in.c:776: undefined reference to > `__aeabi_idivmod' > > From this it seems that arm-none-eabi-gcc (release 2005-Q1C), is> interpretting this division as a floating point operation referenced in a> library that I am not passing to arm-none-eabi-ld. Arm does not have an integer divide instuction, so integer division is implmemented with a library call. This is not a floating point operation. > What library are the __aeabi functions in? libgcc Paul
I apologize if this is a duplicate mailing. My mailer ran into trouble and I do not see the message posted, so here it is again:
I verified this, just in case, doing a `cat /usr/local/lib/gcc/arm-none-eabi/3.4.2/libgcc.a | grep __aeabi_idivmod', since the issue persists.
First I tried: arm-none-eabi-ld -L/usr/local/lib/gcc/arm-none-eabi/3.4.2 -lgcc ... This resulted in `cannot find -lgcc' from the linker. I double checked the path. Seemed correct, so I tried it on a GNU/Linux host. Didn't have the same problem. The GNU/Linux host, however, is running 3.4.3, not 3.4.2.
On the cygwin host, then I manually copied libgcc.a into /usr/local/arm-none-eabi/lib and tried: arm-none-eabi-ld -lgcc ... This fixed the `cannot find -lgcc' issue, but the undefined reference remains. On the GNU/Linux host the undefined reference also remains.
What could be the problem? Cheers, Chris _________________________________________________________________Don?t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/