This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: undefined symbol error when compiling newlib-1.17


The definition of __infinity is probably coming from lines 65-68 in
math.h,
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
libm/common/s_infconst.c.)
 
I don't see anything that jumps out as being wrong, but perhaps it's a
quirk in your gcc 2.7.2.3 (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.
 
Craig

-----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

Greetings,

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
generate
assembly instead of object, in the middle of the assembly I see these
two
lines:

	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
somewhere?

Thank you very much,
Navid


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]