Bug #70269 [NEW]: Tons of warnings and 1 error when building on Mac OS X
| From: | rj at obsigna dot com | Date: | Fri, 14 Aug 2015 11:36:56 +0000 |
| Subject: | Bug #70269 [NEW]: Tons of warnings and 1 error when building on Mac OS X | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-195203@lists.php.net to get a copy of this message | ||
From: rj at obsigna dot com
Operating system: Mac OS X 10.10.5
PHP version: 5.6.12
Package: *Compile Issues
Bug Type: Bug
Bug description:Tons of warnings and 1 error when building on Mac OS X
Description:
------------
I need PostgreSQL support and therefore I frequently build a custom PHP
on my Mac. This time, I built PHP 5.6.12, using the steps below. On Mac
OS X, the default compiler is clang. And clang found a hell lot of
warnings, many of which seem to be real issues and not clang
peculiarities. For example, I saw several like this one:
/Users/rolf/Installation/php-5.6.12/ext/date/php_date.c:2254:6: warning:
absolute value function 'abs' given an argument of type 'long long' but
has parameter of type 'int' which may cause truncation of value
If the incriminated code is used for datetime calculatios with input
values after the year 2038, then it would fail miserably.
Yet another example:
/Users/rolf/Installation/php-5.6.12/ext/pdo/pdo_stmt.c:469:19: warning:
comparison of unsigned expression < 0 is always false
The compilation usually bails out with the following error:
/Users/rolf/Installation/php-5.6.12/ext/sqlite3/libsqlite/sqlite3.c:23512:3:
error: SQLite will not work correctly with the -ffast-math option of
GCC.
# error SQLite will not work correctly with the -ffast-math option of
GCC.
I usually replace that error declaration in sqlite3.c with a warning
one, because clang is not GCC and -ffast-math takes NOT part in the
compiler flags.
My Steps for building PHP on Mac OS X follow:
$ cd ~/Installation
$ export CFLAGS="-Ofast -g0 -Wno-deprecated-declarations"
$ curl -L http://br1.php.net/get/php-5.6.12.tar.bz2/from/this/mirror
-o
php-5.6.12.tar.bz2
$ tar -oxjf php-5.6.12.tar.bz2
$ cd php-5.6.12
$ sed -e "s/# error SQLite will not work correctly with the
\-ffast\-math option of GCC./# warning SQLite will not work correctly
with the \-ffast\-math option of GCC./" -i ""
ext/sqlite3/libsqlite/sqlite3.c
$ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/sbin/apxs
--with-ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib=/usr
--enable-exif --enable-ftp --enable-mbstring --enable-mbregex
--enable-dba --enable-sockets --with-curl=/usr
--with-config-file-path=/etc --sysconfdir=/private/etc
--with-pgsql=/usr/local/pgsql --with-mysql-sock=/var/mysql/mysql.sock
--with-mysql=mysqlnd --with-openssl=/usr --with-xmlrpc --with-xsl=/usr
--with-iconv=/usr
$make | tee ../Warnings-php-5.6.12.txt
You can download the file "Warnings-php-5.6.12.txt" on
"http://blog.obsigna.net/downloads/Warnings-php-5.6.12.txt".
I will
remove it in 30 days.
Best regards
Rolf
--
Edit bug report at https://bugs.php.net/bug.php?id=70269&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70269&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70269&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70269&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70269&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70269&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70269&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70269&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70269&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70269&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70269&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70269&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70269&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70269&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70269&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70269&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70269&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70269&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70269&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70269&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70269&r=mysqlcfg