build/release_xc16v1_25/production/src/fix16.o(.text+0x43a): In function `.LSM71': : undefined reference to `___clzsi2'

28 views
Skip to first unread message

Karl Edler

unread,
Dec 2, 2015, 3:40:32 PM12/2/15
to libfixmath
Hello,

I would like to use the libfixmath library on a dsPIC33. However when I try to compile it, the compiler complains of undefined references to  `___clzsi2'. Does anyone know where this function is coming from?

Regards,
Karl Edler

Karl Edler

unread,
Dec 2, 2015, 4:07:05 PM12/2/15
to libfixmath
Got it. Although the Microchip compiler defines the symbol __GNUC__ it does not define the function __builtin_clzl(x). Therefore
the "#ifdef __GNUC__" statements must be modified to simply define the function: "static uint8_t clz(uint32_t x)".

Then the thing compiles.

Hope this helps someone.... 
Reply all
Reply to author
Forward
0 new messages