undefined symbol error when compiling newlib-1.17

Howland Craig D (Craig) howland@LGSInnovations.com
Thu Jan 22 23:03:00 GMT 2009

The definition of __infinity is probably coming from lines 65-68 in
where HUGE_VAL is defined to be "(__infinity[0].d)", for gcc versions
prior to 3.3 or non-gcc.  It might be best to confirm this by checking
your pre-processed output (-E) and checking for the extern from math.h
line 66 and the HUGE_VAL substitution in the body of __adjust.  It
wouldn't hurt to double-check the union __dmath definition also, to
see that the first member is unsigned long or unsigned int (the __Ulong
being properly replaced with something valid).
(At link time, __infinity is supposed to come from
I don't see anything that jumps out as being wrong, but perhaps it's a
quirk in your gcc (which I assume you're still using).  Assuming
the pre-processor output doesn't show anything weird, it might be
interesting to try taking out the () in the HUGE_VAL define. (To
experiment, I'd probably just put "__infinity[0].d" in for the two
occurrences of HUGE_VAL in __adjust.c.)
The error message is almost as if math.h line 66 (extern ... __inf...)
has been missed, yet the macro definition from line 67 is being used.

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of Navid Toosizadeh
Sent: Thursday, January 22, 2009 5:00 PM
To: newlib@sourceware.org
Subject: undefined symbol error when compiling newlib-1.17


When I compile newlib for my added target, I get this error message when
it tries to compile __adjust.c in stdlib:

/tmp/ccQ6Jtph.s: Assembler messages:
/tmp/ccQ6Jtph.s:31: Error: undefined symbol `___infinity' in operation
/tmp/ccQ6Jtph.s:32: Error: undefined symbol `___infinity' in operation

I tried to unsderstand the provblem, I altered the gcc comand to
assembly instead of object, in the middle of the assembly I see these

	lhi	r1,((___infinity)>>16)&0xffff
	addui	r1,r1,(___infinity)&0xffff

which I believe are the cause of the problem. Any ideas on what is the
causeof this/ if I should get the definition of ___infinity from

Thank you very much,

More information about the Newlib mailing list