[Aboriginal] undefined reference to `finite'
rlandley at parallels.com
Tue Apr 5 04:35:02 PDT 2011
On 04/05/2011 05:12 AM, David Seikel wrote:
> I'm very tired, and slightly ill, and I can't figure this out.
> One of the packages from the UI library I want to use for this project
> uses a function called finite(double). As far as I can tell, uClibc
> should supply that function, since we have DO_C99_MATH=y in its
> baseconfig. It's not being found though.
> It's all buried in a forest of #ifdef's that my tired mind is in no
> condition to sort out.
> I'm only two packages away for having all my needed libraries installed
> before I can start cutting code. Time to sleep.
Hmmm... Posibly a question for the uClibc mailing list?
You didn't say which target you were using, so I'll poke at x86_64:
$ cd build/cross-compiler-x86_64/lib
$ grep finite *
Binary file libm-0.9.31.so matches
Binary file libm.a matches
Binary file libm.so matches
Binary file libm.so.0 matches
$ ../bin/x86_64-readelf -a libm.so | grep finite
40: 0000000000007ad0 18 FUNC GLOBAL DEFAULT 6 __finitef
58: 000000000000656c 23 FUNC GLOBAL DEFAULT 6 __finite
63: 0000000000000000 0 FILE LOCAL DEFAULT ABS s_finite.c
102: 0000000000000000 0 FILE LOCAL DEFAULT ABS s_finitef.c
171: 0000000000007ad0 18 FUNC LOCAL HIDDEN 6 __GI___finitef
177: 000000000000656c 23 FUNC LOCAL HIDDEN 6 __GI___finite
290: 0000000000007ad0 18 FUNC GLOBAL DEFAULT 6 __finitef
308: 000000000000656c 23 FUNC GLOBAL DEFAULT 6 __finite
It looks like the problem is that uClibc is sticking two underscores on
the front of the "finite" symbol. I'm not sure why. It's not doing
that with other symbols, ala:
$ ../bin/x86_64-readelf -a libm.so | grep floor
28: 0000000000006584 299 FUNC GLOBAL DEFAULT 6 floor
131: 0000000000007de8 19 FUNC GLOBAL DEFAULT 6 floorf
64: 0000000000000000 0 FILE LOCAL DEFAULT ABS s_floor.c
162: 0000000000006584 299 FUNC LOCAL HIDDEN 6 __GI_floor
278: 0000000000006584 299 FUNC GLOBAL DEFAULT 6 floor
381: 0000000000007de8 19 FUNC GLOBAL DEFAULT 6 floorf
My next step would be to dig down into the uClibc source code and build
system and try to figure out where that symbol comes from and maybe if
there's some sort of other config symbol to tell it not to do that.
(The build leaves that under build/packages/uClibc by the way, extracted
with all patches applied. The gory details are explained at
http://landley.net/aboriginal/FAQ.html#debug_source although there's a
lot of reading to do to hack through it all. It was more elaborate to
write, and if you have suggestions for simplifying it I'm all ears. But
understand what it _does_ first, please...)
By the way, have you read this yet?
One of the best quick and dirty "get familiar with elf file format"
things I've seen...
More information about the Aboriginal