|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-09-29 02:32 UTC] php-bugs-2014 at ryandesign dot com
Description:
------------
Hello, I'm the maintainer of PHP in MacPorts.
The latest versions of PHP 5.5 (5.5.17) and 5.4 (5.4.33) do not build in MacPorts with gcc (e.g. gcc 4.2.1 as provided by Xcode on Mac OS X 10.6):
Undefined symbols:
"___extendsddf", referenced from:
_ps_fetch_float in mysqlnd_ps_codec.o
"___extendsfsd", referenced from:
_ps_fetch_float in mysqlnd_ps_codec.o
ld: symbol(s) not found
They build fine in MacPorts with clang (as provided by Xcode on OS X 10.7 and up).
This problem was reported to the MacPorts project here:
https://trac.macports.org/ticket/45197
This problem does not occur with the latest versions of PHP 5.3 (5.3.29) or 5.6 (5.6.0), nor did it happen with the previous versions of PHP 5.4 (5.4.32) or 5.5 (5.5.16).
In case it is relevant, we are configuring with PHP_MYSQLND_ENABLED=yes.
Patchespatch-php56-ext-mysqlnd-config9.m4.diff (last revision 2014-11-04 02:17 UTC by php-bugs-2014 at ryandesign dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
I can verify on this machine: $ uname -a Darwin foo 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:57:13 PST 2010; root:xnu-1504.3.12~1/RELEASE_X86_64 x86_64 $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1) Copyright (C) 2007 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. Running configure I see checking whether whether compiler supports Decimal32/64/128 types... yes This is unexpected as manually trying the configure-test fails: $ cat test.c #include <stdio.h> int main(int argc, char **argv) { typedef float dec32 __attribute__((mode(SD))); dec32 k = 99.49f; double d2 = (double)k; return 0; } $ gcc test.c Undefined symbols: "___extendsddf", referenced from: _main in ccAnM5bQ.o ld: symbol(s) not found collect2: ld returned 1 exit status If I change the test in config9.m4 in another way that it should compile, but fail to link (add a line "does_not_exist();") the test fails as expected. Observation so far: The code fails when building stand-alone and when building as part of the PHP build, whoever it seems to work in configure's context. For a test I also changed from AC_TRY_RUN to AC_TRY_LINK. With AC_TRY_LINK this test fails on the Mac machine, but also on a Linux+gcc box where it used to work with AC_TRY_RUN. So I am confussed.I've at least figured out what the difference is between compiling the test script on the command line and having the configure script compile it: the configure script uses the CFLAGS, CXXFLAGS, CPPFLAGS, LDFLAGS and LIBS it's given, which in MacPorts' case includes optimization flags. When using any optimization level above 0, the test script (either the old version or the new version) compiles with no error: $ gcc-apple-4.2 test.c -o test -O0; echo $? Undefined symbols: "___extendsddf", referenced from: _main in cc22Pp30.o ld: symbol(s) not found collect2: ld returned 1 exit status 1 $ gcc-apple-4.2 test.c -o test -O1; echo $? 0Hello, I was reading with great interest the comment on this bug as of 8 October. I experienced the exact same issue while trying to compile php 5.6.1 with Apache 2.4.10. The flags I used were: LD_LIBRARY_PATH=/usr/X11R6/lib:/usr/local/lib:/Developer/SDKs/MacOSX10.6.sdk/usr/lib:/opt/gnome/lib:/usr/lib:/usr/local/pgsql/lib:/usr/local/BerkeleyDB/lib:/sw/lib LDFLAGS=-L/usr/local/BerkeleyDB/lib -L/sw/lib and the configure arguments were: ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --enable-mod-charset --with-config-file-path=/usr/local/php/etc --with-openssl --with-libxml-dir=/sw --with-pcre-regex=/usr/local/pcre --with-zlib=/usr --with-bz2 --enable-calendar --with-curl --enable-exif --with-gd --with-jpeg-dir=/sw --with-png-dir=/sw --with-xpm-dir=/usr/X11 --with-freetype-dir=/usr/X11 --with-t1lib=/sw --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp=/sw --with-mhash --with-imap --with-kerberos --with-imap-ssl --with-ldap --enable-mbstring --with-mcrypt=/sw --with-mysql --with-pgsql --enable-cli --with-readline=/sw --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xsl --with-zlib --with-libexpat-dir=/usr --with-libxml-dir=/sw --with-xmlrpc --with-libzip=/sw --with-pear --enable-bcmath --enable-intl --with-icu-dir=/sw --with-iconv-dir=/usr The error is: Undefined symbols: "___extendsddf", referenced from: _ps_fetch_float in mysqlnd_ps_codec.o "___extendsfsd", referenced from: _ps_fetch_float in mysqlnd_ps_codec.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [libs/libphp5.bundle] Error 1 I am clueless as to how to solve this problem and would appreciate any assistance to help resolve this. Regards, JacquesMy assumption is that the fact that the configure test compiles and links is an error. Disabling optimizations for the duration of the configure test works around that error and allows the configure test to properly detect the absence of decimal fp support. Yes, this is papering over a bug in the compiler and/or linker but that's the best we can hope for since Apple is not going to be releasing any updated versions of the developer tools for the affected OS X versions because they are several major versions old by now. Inspecting the value of __APPLE_CC__ doesn't seem likely to help identify the broken compilers in this situation. With an affected version of gcc from OS X 10.6 ("gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)"), the value of __APPLE_CC__ is "5666". However that OS X version also includes the llvm-gcc compiler ("gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.6)") which is not affected by the problem and its __APPLE_CC__ value is "5658". An early version of clang is also included ("Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)"); it is not affected by the bug and its __APPLE_CC__ value is "5621". The version of gcc-4.2 on OS X 10.5 ("gcc version 4.2.1 (Apple Inc. build 5577)") is affected; its __APPLE_CC__ value is 5577. It doesn't seem necessary to identify the affected compilers in any way; just disable optimizations for this configure test. This should not have any adverse effects on the test's ability to detect the feature on other platforms nor would it have any effect on the final executable's performance. You previously asked me to compile and run a snippet. Here's the result on OS X 10.5: $ gcc-4.2 snippet.c Undefined symbols: "___extendsddf", referenced from: _main in ccODpbxz.o ld: symbol(s) not found collect2: ld returned 1 exit status $ gcc-4.2 -O1 snippet.c $ ./a.out Expected: 99.49, Actual: 99.490000 $ echo $? 0 $