Re: Problem with CVS source
"Nikos Balkanas" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <004101c93ada$391e5320$02b2a8c0@tardis> |
Dear Martin, Thanks for the input. After serching fora for similar problems I found some stating issues between Solaris 10 include files and gcc compatibility. In fact in /usr/include/iso/math_c99.h Solaris defines: #define HUGE_VAL __builtin_huge_val Now, this may be fine for their own compiler, but clashes with gcc. gcc expects the following: #define HUGE_VAL __builtin_huge_val() By making this change in /usr/include/iso/math_c99.h the CVS compiles. Since I am not using sun's compiler I made the change. -or- even better The difference between CVS and 1.4.1 lies in the compiler definitions. CVS defines _STDC_C99 and ends up using /usr/include/iso/math_c99.h's broken definition, whereas 1.4.1 doesn't define it and uses /usr/include/iso/math_iso.h's definition that works: #define HUGE_VAL __huge_val._d Both includes are first referenced in math.h and are applied conditionally based on that flag. Anybody knows what is the purpose of _STDC_C99 and why did it start been used in CVS? It could be that in Solaris it exists solely to flag Sun's compiler. BR, Nikos ----- Original Message ----- From: "Nikos Balkanas" <[email protected]> To: "Martin Conte Mac Donell" <[email protected]> Cc: <[email protected]> Sent: Wednesday, October 29, 2008 5:35 AM Subject: Re: Problem with CVS source > Dear Martin, > > gcc is the standard stock 64bit gcc shipped with Solaris 10. > > Server2:~-> gcc -v > Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs > Configured with: > /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas > --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ > --enable-shared > Thread model: posix > gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath) > > It doesn't seem to be a gcc issue, inasmuch the same exactly source code > compiles without a problem with gateway-1.4.1. Includes are also identical > upto 1 level below (cannot follow the whole tree). > > You have a better acquaintance with the code at that point. I don't > disagree that a correct solution is needed, but in a 64-bit compilation > what is the use of cheking the limits on a 32bit float? Of course you have > the same problem with a 32bit compile and this time it may be more > crucial. > > Nikos > > ----- Original Message ----- > From: "Martin Conte Mac Donell" <[email protected]> > To: "Nikos Balkanas" <[email protected]> > Cc: <[email protected]> > Sent: Wednesday, October 29, 2008 5:04 AM > Subject: Re: Problem with CVS source > > >> 2008/10/28 Nikos Balkanas <[email protected]>: >>> Hi, >>> >>> After looking at it a bit longer, I think I need some help with it. In >>> Solaris 10.5 the cvs is broken. The build failes in wmlscript/wlexer.c >>> (1037): >>> >>> if (*result == *HUGE_VAL || *result == -(*HUGE_VAL)>.>..>..// NIKOS!! >>> || ws_ieee754_encode_single(*result, buf) != WS_IEEE754_OK) >>> ws_src_error(compiler, 0, "floating point literal too large"); >>> Are these lines really important? We are talking for a 64bit build here >>> (of >>> course the same lines will affect 32bit builds as well). HUGE_VAL is >>> undefined in the CVS version: >>> >>> Undefined first referenced >>> symbol in file >>> __builtin_huge_val libwmlscript.a(wslexer.o) >>> ld: fatal: Symbol referencing errors. No output written to >>> wmlscript/wmlsc >>> This is after I commented out the relevant code in wslexer.c and filled >>> in >>> for a simple printf. Of interest is that in the CVS version HUGE_VAL is >>> a >>> undefined pointer, whereas in the 1.4.1 version it is a float(correct). >>> >>> Source, includes and dependencies are exactly the same: >>> >>> gateway-1.4.1/.depend: >>> wmlscript/wslexer.o: wmlscript/wslexer.c wmlscript/wsint.h ./gw-config.h >>> \ >>> ./gwlib/gwassert.h ./gwlib/log.h wmlscript/ws.h wmlscript/wsutf8.h \ >>> wmlscript/wserror.h wmlscript/wsieee754.h wmlscript/wsbuffer.h \ >>> wmlscript/wsencode.h wmlscript/wsalloc.h wmlscript/wsfalloc.h \ >>> wmlscript/wsstream.h wmlscript/wshash.h wmlscript/wsbc.h \ >>> wmlscript/wsstree.h wmlscript/wsasm.h wmlscript/wsopt.h \ >>> wmlscript/wsstdlib.h wmlscript/wsgram.h >>> >>> CVS/.depend: >>> wmlscript/wslexer.o wmlscript/wslexer.i: wmlscript/wslexer.c \ >>> wmlscript/wsint.h ./gw-config.h ./gwlib/gwassert.h ./gwlib/log.h \ >>> wmlscript/ws.h wmlscript/wsutf8.h wmlscript/wserror.h \ >>> wmlscript/wsieee754.h wmlscript/wsbuffer.h wmlscript/wsencode.h \ >>> wmlscript/wsalloc.h wmlscript/wsfalloc.h wmlscript/wsstream.h \ >>> wmlscript/wshash.h wmlscript/wsbc.h wmlscript/wsstree.h \ >>> wmlscript/wsasm.h wmlscript/wsopt.h wmlscript/wsstdlib.h \ >>> wmlscript/wsgram.h >>> Where is wmlscript invoked? I have some issues right now with the >>> client, so >>> I cannot run a debugger on it. >>> >>> Any help would be appreciated. >>> >>> Thanks, >>> Nikos >>> >>> ----- Original Message ----- >>> From: Nikos Balkanas >>> To: Stipe Tolj >>> Cc: [email protected] >>> Sent: Monday, October 27, 2008 9:43 PM >>> Subject: Re: Problem with CVS source >>> >>> Dear Stipe, >>> >>> It seems that the problem is not what I first suspected. You see the >>> file >>> wslexer.c is exactly the same in both cases (gateway-1.4.1 and cvs >>> gateway). >>> Therefore it is not a HUGE_VAL problem I first suspected. >>> >>> This is strange. I am using exactly the same environment, gcc, >>> configuration >>> as with the gateway-1.4.1 version. Yet make fails on exactly the same >>> file. >>> I will have to look more into it. Meanwhile if you have seen this >>> before, >>> pls let me know. >>> >>> Nikos >>> On Mon, Oct 27, 2008 at 9:26 PM, Nikos Balkanas <[email protected]> >>> wrote: >>>> >>>> Thanks, Stipe, for the fast reply. Please see my comments inlined. >>>> >>>> Regards, >>>> >>>> Nikos >>>> >>>> On Mon, Oct 27, 2008 at 8:10 PM, Stipe Tolj <[email protected]> wrote: >>>>> >>>>> Nikos Balkanas schrieb: >>>>> > Hi, >>>>> > >>>>> > I am rather new to the list. I tried to download and compile the >>>>> > latest >>>>> > CVS source and I got the following error: >>>>> > >>>>> > gcc -std=gnu99 -D_REENTRANT=1 -I. -Igw -O6 -s -m64 -D_LARGE_FILES= >>>>> > -I/usr/include/libxml2 -I/usr/local/include -Wall -Wmissing-prototypes >>>>> > -Wmissing-declarations -Wnested-externs -Winline -Wformat >>>>> > -Wformat-security -Wmissing-format-attribute -Wall >>>>> > -I/usr/local/ssl/include -o wmlscript/wslexer.o -c >>>>> > wmlscript/wslexer.c >>>>> > wmlscript/wslexer.c:222: warning: no previous prototype for >>>>> > 'ws_yy_lex' >>>>> > wmlscript/wslexer.c: In function `read_float_from_exp': >>>>> > wmlscript/wslexer.c:1037: error: invalid operands to binary == >>>>> > wmlscript/wslexer.c:1038: error: wrong type argument to unary minus >>>>> > make: *** [wmlscript/wslexer.o] Error 1 >>>>> >>>>> there is something wrong with your local CVS checkout tree. Make sure >>>>> you >>>>> >>>>> $ make clean >>>>> $ make >>>> >>>> To be sure I rm -rf gateway and restored from CVS again. >>>> >>>>> >>>>> in order to remove any previously build objects. The configure run was >>>>> clean? >>>> >>>> >>>> Yes. Apart from docbook support which I don't particular care (This is >>>> a >>>> minimal server for security/performance reasons) >>>> CFLAGS="-O6 -s -m64 -DSunOS" CPPFLAGS="-I/usr/local/ssl/include" >>>> configure --build=ia64-pc-solaris2.10 --libdir=/usr/local/lib/64 >>>> --enable-ssl --enable-cookies --enable-debug --enable-warnings --enable-docs >>>> --mandir=/usr/local/man --with-ssl=/usr/local/ssl --enable-pcre >>>> >>>> gateway-1.4.1 compiled with the same configuration with no problems. >>>> The issue seems to be with HUGE_VAL and Solaris. I don't have a linux >>>> in >>>> front of me to check, but in solaris 10.5 in >>>> /usr/include/iso/math_iso.h: >>>> #define HUGE_VAL __huge_val._d >> >> HUGE_VAL is a standard C feature. And __builtin_huge_val() is a >> GCC-specific extension for implementing this one. >> >> gcc had some troubles with math.h in solaris. >> >> Which gcc version are you using? >> >> M >