php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41699 Compile failure with gcc 4.1.2 and varargs.h
Submitted: 2007-06-15 09:40 UTC Modified: 2007-06-28 08:50 UTC
From: webtech at get-telecom dot fr Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.3 OS: Solaris 10 (AMD64)
Private report: No CVE-ID: None
 [2007-06-15 09:40 UTC] webtech at get-telecom dot fr
Description:
------------
I've tried to compile PHP 5.2.3 on Solaris 10 (AMD64) with gcc 4.1.2.

Everything's OK when compiling with gcc 3.4.1 but with gcc 4.1.2, I've this following error :

/opt/gcc412/lib/../lib/gcc/i386-pc-solaris2.10/4.1.2/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>."
/opt/gcc412/lib/../lib/gcc/i386-pc-solaris2.10/4.1.2/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>."

I've seen the bug #34977 but it seems to be fixed in PHP 5.2.3.

Expected result:
----------------
Compile OK.

Actual result:
--------------
/bin/sh /www/src/php-5.2.3/libtool --silent --preserve-dup-deps --mode=compile gcc  -DNOT_RUBY -DHAVE_CONFIG_H -Iext/mbstring/ -I/www/src/php-5.2.3/ext/mbstring/ -DPHP_ATOM_INC -I/www/src/php-5.2.3/include -I/www/src/php-5.2.3/main -I/www/src/php-5.2.3 -I/usr/pkg/include/libxml2 -I/usr/pkg//include -I/www/src/php-5.2.3/ext/date/lib -I/www/src/php-5.2.3/ext/mbstring/oniguruma -I/www/src/php-5.2.3/ext/mbstring/libmbfl -I/www/src/php-5.2.3/ext/mbstring/libmbfl/mbfl -I/db/mysql/include -I/www/src/php-5.2.3/TSRM -I/www/src/php-5.2.3/Zend  -D_POSIX_PTHREAD_SEMANTICS -I/usr/pkg/include  -I/usr/include -g -O2   -c /www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c -o ext/mbstring/oniguruma/regerror.lo
In file included from /www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:37:
/opt/gcc412/lib/../lib/gcc/i386-pc-solaris2.10/4.1.2/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>."
/opt/gcc412/lib/../lib/gcc/i386-pc-solaris2.10/4.1.2/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>."
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c: In function 'onig_error_code_to_str':
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:196: error: expected declaration specifiers before 'va_dcl'
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:265: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'OnigUChar'
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:271: error: expected declaration specifiers before 'va_dcl'
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:270: error: declaration for parameter 'fmt' but no such parameter
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:269: error: declaration for parameter 'pat_end' but no such parameter
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:268: error: declaration for parameter 'pat' but no such parameter
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:267: error: declaration for parameter 'enc' but no such parameter
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:266: error: declaration for parameter 'bufsize' but no such parameter
/www/src/php-5.2.3/ext/mbstring/oniguruma/regerror.c:334: error: expected '{' at end of input
gmake: *** [ext/mbstring/oniguruma/regerror.lo] Error 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-21 13:39 UTC] sniper@php.net
Do you have some CFLAGS / CPPFLAGS set before running configure / make ?
 [2007-06-21 14:13 UTC] webtech at get-telecom dot fr
No, no CFLASGS / CPPFLAGS variable are set.

My defaut compiler is gcc3. In order to use gcc4, I've added at the beginning of the PATH variable :
$gcc4_home/bin:$gcc4_home/include:$gcc4_home/lib
 [2007-06-27 11:47 UTC] tony2001@php.net
Please put your config.log somewhere so that I can take a look at it.
 [2007-06-27 13:27 UTC] webtech at get-telecom dot fr
OK, you can have a look at perso.enst.fr/~allain/phptemp/config.log
 [2007-06-27 13:45 UTC] tony2001@php.net
./configure fails to detect this because of the problem below:

configure:52817: gcc -o conftest -I/usr/include -g -O2  -D_POSIX_PTHREAD_SEMANTICS -I/usr/pkg/include -L/usr/lib  -L/usr/pkg/lib -R/usr/ucblib -L/usr/ucblib -R/opt/gcc412/lib/gcc/i386-pc-solaris2.10/4.1.2 -L/opt/gcc412/lib/gcc/i386-pc-solaris2.10/4.1.2 -R/usr/pkg/lib -L/usr/pkg/lib -R/usr/pkg//lib -L/usr/pkg//lib conftest.c -lldap -llber -lgd -lpng -lz -ljpeg -lcurl -lz -lresolv -lm -lnsl -lsocket  -lgcc -lxml2 -lz -lm -lsocket -lnsl -lcurl -lidn -lssl -lcrypto -lsocket -lnsl -lz -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: fatal: file /usr/pkg/lib/liblber.so: wrong ELF class: ELFCLASS64
ld: fatal: file /usr/pkg/lib/libgd.so: wrong ELF class: ELFCLASS64
ld: fatal: file /usr/pkg/lib/libcurl.so: wrong ELF class: ELFCLASS64
ld: fatal: file /usr/pkg/lib/libcurl.so: wrong ELF class: ELFCLASS64
ld: fatal: file /usr/pkg/lib/libidn.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to conftest
collect2: ld returned 1 exit status

Looks like you put 64bit libraries to wrong place.
 [2007-06-28 08:40 UTC] webtech at get-telecom dot fr
You're right, I just add "-m64" in CFLAGS and LDFLAGS variables and now it compiles.

The only problem is that when I configured compilation, I had no error messages, only when I took a look in config.log...

Thanks for your help.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 06:01:34 2025 UTC