Bug #68987 [NEW]: Failed to compile zend.c with gcc-4.9.2

From: Date: Thu, 05 Feb 2015 08:07:22 +0000
Subject: Bug #68987 [NEW]: Failed to compile zend.c with gcc-4.9.2
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190472@lists.php.net to get a copy of this message
From:             191919 at gmail dot com
Operating system: OS X
PHP version:      master-Git-2015-02-05 (Git)
Package:          Compile Failure
Bug Type:         Bug
Bug description:Failed to compile zend.c with gcc-4.9.2

Description:
------------
On my OS X Yosemite 10.10.2, gcc-4.9.2 failed to compile zend.c.

$ uname -a
Darwin localhost 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22
23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64

$ /opt/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/bin/gcc
COLLECT_LTO_WRAPPER=/opt/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../gcc-4.9.2/configure --prefix=/opt
--enable-languages=c,c++,objc,obj-c++
Thread model: posix

$ CC=/opt/bin/gcc CFLAGS="-O3 -mssse3 -ftree-vectorize -funroll-loops
-fomit-frame-pointer -fno-stack-protector -fno-exceptions" ./configure
--prefix=/opt/php7
$ make

... (a lot of lines omitted) ...

/bin/sh /Users/xx/box/php-src/libtool --silent --preserve-dup-deps
--mode=install cp ext/opcache/opcache.la /Users/xx/box/php-src/modules
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: /Users/xx/box/php-src/modules/opcache.a(shared_alloc_shm.o) has no
symbols
/bin/sh /Users/xx/box/php-src/libtool --silent --preserve-dup-deps
--mode=compile /opt/bin/gcc  -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -IZend/
-I/Users/xx/box/php-src/Zend/ -DPHP_ATOM_INC
-I/Users/xx/box/php-src/include -I/Users/xx/box/php-src/main
-I/Users/xx/box/php-src -I/Users/xx/box/php-src/ext/date/lib
-I/Users/xx/box/php-src/ext/ereg/regex -I/usr/local/include/libxml2
-I/Users/xx/box/php-src/ext/sqlite3/libsqlite
-I/Users/xx/box/php-src/TSRM -I/Users/xx/box/php-src/Zend   
-I/usr/include -O3 -mssse3 -ftree-vectorize -funroll-loops -ffast-math
-fomit-frame-pointer -fno-stack-protector -fno-exceptions
-fvisibility=hidden  -c /Users/xx/box/php-src/Zend/zend.c -o
Zend/zend.lo 
In file included from /Users/xx/box/php-src/Zend/zend.c:22:0:
/Users/xx/box/php-src/Zend/zend.h:86:30: error: redefinition of
'zend_error'
 # define zend_error_noreturn zend_error
                              ^
/Users/xx/box/php-src/Zend/zend.c:1214:29: note: in expansion of macro
'zend_error_noreturn'
 ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char
*format, ...)
                             ^
/Users/xx/box/php-src/Zend/zend.c:1205:15: note: previous definition of
'zend_error' was here
 ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
               ^
make: *** [Zend/zend.lo] Error 1

I checked the problem lines in zend.c:

#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) &&
!defined(DARWIN) && !defined(__hpux) && !defined(_AIX) &&
!defined(__osf__))
void zend_error_noreturn(int type, const char *format, ...)
__attribute__ ((alias("zend_error"),noreturn));
#elif defined(ZEND_WIN32) || defined(DARWIN)
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
{
	va_list va;

	va_start(va, format);
	zend_error_va_list(type, format, va);
	va_end(va);
}

ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char
*format, ...)
{
	va_list va;

	va_start(va, format);
	zend_error_va_list(type, format, va);
	va_end(va);
}
/* }}} */
#endif

As defined in zend.h:

#ifdef HAVE_NORETURN
# if defined(ZEND_WIN32)
ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char
*format, ...);
# else
void zend_error_noreturn(int type, const char *format, ...)
ZEND_NORETURN;
# endif
#else
# define zend_error_noreturn zend_error
#endif

zend_error_noreturn is defined as zend_error, so

ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char
*format, ...)

is expanded to

ZEND_API ZEND_NORETURN void zend_error(int type, const char *format,
...)

which is already defined.



Expected result:
----------------
Compilation succeeds.

Actual result:
--------------
Compilation failed.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=68987&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=68987&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=68987&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=68987&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=68987&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=68987&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=68987&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=68987&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=68987&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=68987&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=68987&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=68987&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=68987&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=68987&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68987&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=68987&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=68987&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=68987&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68987&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=68987&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=68987&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#190472) next »