php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31131 zend_strtod.c compilation fails: Exactly one of IEEE_LITTLE_ENDIAN ...
Submitted: 2004-12-16 18:41 UTC Modified: 2004-12-21 10:55 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: Bjorn dot Wiberg at its dot uu dot se Assigned: derick
Status: Closed Package: Compile Failure
PHP Version: 5.0.3 OS: IBM AIX 5.2.0.0 ML4
Private report: No CVE-ID:
 [2004-12-16 18:41 UTC] Bjorn dot Wiberg at its dot uu dot se
Description:
------------
Compilation of zend_strtod.c fails. Similar to http://bugs.php.net/bug.php?id=31129, but under AIX and with PHP 5.0.3.

(5.0.2 worked fine in this regard.)

Seems to be caused by some define not being set:

#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \
    defined(IBM) != 1
Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or
IBM should be defined.
#endif


Reproduce code:
---------------
[config.nice excerpt]

'./configure' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-dba' \
'--enable-exif' \
'--enable-embedded-mysqli' \
'--enable-filepro' \
'--enable-ftp' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-mbstring' \
'--enable-memory-limit' \
'--enable-sockets' \
'--enable-versioning' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-bz2' \
'--with-freetype-dir' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-imagick' \
'--with-inifile' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir' \
'--with-mime-magic' \
'--with-mnogosearch' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl=/opt/freeware' \
'--with-png-dir' \
'--with-tiff-dir' \
'--with-ttf' \
'--with-xpm-dir' \
'--with-zlib' \
'--with-zlib-dir' \


/usr/local/bin/gcc --version
gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc 3.3.2 installed as .bff package from www.bullfreeware.com.

LIBPATH=/usr/lib:/lib:/opt/freeware/lib:/usr/local/lib:/usr/ccs/lib:/usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2:/opt/freeware/GNUPro/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/2.9-aix51-020209/:/usr/local/lib/graphviz


Expected result:
----------------
Successful compilation.

Actual result:
--------------
From the compile output:

/../

/bin/sh /usr/local/src/php-5.0.3/libtool --silent --preserve-dup-deps
--mode=compile /usr/local/bin/gcc  -IZend/
-I/usr/local/src/php-5.0.3/Zend/ -DPHP_ATOM_INC
-I/usr/local/src/php-5.0.3/include -I/usr/local/src/php-5.0.3/main
-I/usr/local/src/php-5.0.3 -I/usr/local/src/php-5.0.3/Zend
-I/opt/freeware/include/libxml2 -I/opt/freeware/include
-I/usr/local/include -I/usr/X11R6/include -I/usr/include/freetype2
-I/usr/local/src/php-5.0.3/ext/mbstring/oniguruma
-I/usr/local/src/php-5.0.3/ext/mbstring/libmbfl
-I/usr/local/src/php-5.0.3/ext/mbstring/libmbfl/mbfl
-I/usr/local/mnogosearch/include -I/usr/local/mysql/include/mysql 
-I/usr/local/include -I/usr/local/src/php-5.0.3/TSRM  -g -O2 
-prefer-pic -c /usr/local/src/php-5.0.3/Zend/zend_strtod.c -o
Zend/zend_strtod.lo 
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:233: error: parse error
before "one"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:234: error: parse error
before "IBM"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:240: error: parse error
before '}' token
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:240: warning: data
definition has no type or storage class
/usr/local/src/php-5.0.3/Zend/zend_strtod.c: In function `ulp':
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:928: error: parse error
before "x"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:930: error: parse error
before "a"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:932: error: `x' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:932: error: (Each undeclared
identifier is reported only once
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:932: error: for each
function it appears in.)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:940: error: `a' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c: In function `b2d':
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:970: error: parse error
before "d"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:988: error: `d' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c: In function `d2b':
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1041: error: parse error
before "d"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1046: error: `d' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c: In function `ratio':
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1172: error: parse error
before "da"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1175: error: `da' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1176: error: `db' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c: In function `zend_strtod':
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1243: error: parse error
before "rv"
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1252: error: `rv' undeclared
(first use in this function)
/usr/local/src/php-5.0.3/Zend/zend_strtod.c:1485: error: `rv0'
undeclared (first use in this function)
make: *** [Zend/zend_strtod.lo] Error 1
root@spinus:/usr/local/src/php-5.0.3#

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-16 22:28 UTC] derick@php.net
If you can provide me with an account, I would be happy to debug it for you.

Derick
 [2004-12-17 08:29 UTC] Bjorn dot Wiberg at its dot uu dot se

 [2004-12-17 15:35 UTC] robin_j77 at hotmail dot com
I got this a similar installation to compile on AIX 5.2 by commenting out the line "Exactly one of the ....." mentioned in the code snippet in the original bug report.  I'm not a programmer to me but it looks like this should be a comment and not actually code.

Hope that helps,
Robin
 [2004-12-17 15:44 UTC] derick@php.net
Incorrect, it should NOT be a comment.
Bjorn, I'm making a patch now to solve it in a more generic way. Will send you a patch with this after the weekend.
 [2004-12-17 16:09 UTC] Bjorn dot Wiberg at its dot uu dot se

 [2004-12-17 22:23 UTC] cantelow at csd dot net
Same error on Tru64 4.0G.  If I force definition of little endian with a separate #define, it bypasses this one but fails on:
cc: Error: /usr/users3/sysop/build/php/php-4.3.10/Zend/zend_strtod.c, line 246: Missing type specifier or type qualif
ier. (missingtype)
        ULong ul[2];

We can also give you an account for debugging if you like, thanks sincerely.
 [2004-12-21 05:52 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

All mentioned platforms tested succesfully. (compiles just fine)

 [2004-12-21 10:54 UTC] Bjorn dot Wiberg at its dot uu dot se

 [2004-12-21 10:55 UTC] derick@php.net
Jani fixed it here, but thanks ;-)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 05:03:19 2014 UTC