Edit report at https://bugs.php.net/bug.php?id=53188&edit=1
ID: 53188 Comment by: pancake at nopcode dot org Reported by: jeremy dot iglehart at gmail dot com Summary: php_date.c fails to compile (code line 499) Status: Feedback Type: Bug Package: Compile Failure Operating System: Darwin (iPod OS4) PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: There's also a problem linking against libiconv. because the symbol name is libiconv() and not iconv(). Doing a #define on iconv.c is enought to bypass this issue. Anyway. none of the hacks I did shuold be in mainstream, they are just hacks :) I don't have time to write proper patch, but with those hints any php dev can write the proper patch and commit it. If you have any question or you need to test just ping me. Previous Comments: ------------------------------------------------------------------------ [2012-04-25 12:38:46] [email protected] hi! I would suggest to provide a patch against master, with the correct #ifdef to modify the sources only if iOS is used. ------------------------------------------------------------------------ [2012-04-25 12:15:08] pancake at nopcode dot org After fixing this issue, everything compiles fine, but the linking fails. To fix the libresolv issue, exit ext/standard/dns.c and write this at line 78 #define res_9_init res_init #define res_9_search res_search #define res_9_expand res_expand #define res_9_dn_skipname __dn_skipname #define res_9_dn_expand dn_expand ------------------------------------------------------------------------ [2012-04-25 11:20:11] pancake at nopcode dot org I have been checking this bug as I'm the maintainer of cydia.radare.org.. and someone on twitter asked me to build an updated package of php... After an hour messing around the different nested macros I end up finding the problem. As i'm quite lazy, i'm not going to send a patch, but rather explain how to fix it. The problem is in the Zend/zend_ini.h:32 , in this line there's the definition of XtOffsetOf macro.. which is wrong and this causes gcc to fail in that way. My fix was removing all definitions of XtOffsetOf and replace it with a single and portable one: #define XtOffsetOf(type, member) ((unsigned long) &((type*)0)->member) feel free to submit patch on the main repo. I'm using this XtOffsetOf macro in some projects of mine in multiple compilers/archs/OS without any issue. So maybe you can simplify the code instead of just handling that case. Anyway... the build i'm doing (php-5.4.0) will be available in binary form in the cydia.radare.org repo. ------------------------------------------------------------------------ [2012-01-25 15:26:16] bobwei9 at hotmail dot com Now the error is on line 500⦠with php 5.4 on ios5.0.1 Could you pelase fix this? ------------------------------------------------------------------------ [2010-10-29 12:17:23] [email protected] Where did you source your toolchain from? PHP does run on jailbroken iOS devices (the Telesphoreo repository has 5.2.8 available), but I'd be surprised if that wasn't being cross-compiled off OS X via XCode. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=53188 -- Edit this bug report at https://bugs.php.net/bug.php?id=53188&edit=1
