#44462 [NoF->Opn]: Can't compile embed sapi on OSX

[email protected] ("graham+php at nexopia dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               44462
 User updated by:  graham+php at nexopia dot com
 Reported By:      graham+php at nexopia dot com
-Status:           No Feedback
+Status:           Open
 Bug Type:         Compile Failure
 Operating System: OSX
-PHP Version:      5.2CVS-2008-03-18
+PHP Version:      5.2CVS-2009-03-25
 New Comment:

Incidentally, this bug is now a year old, has a functioning patch that
resolves the issue, and has still not been fixed upstream.


Previous Comments:
------------------------------------------------------------------------

[2009-03-17 22:49:07] graham-php at nexopia dot com

Still happening with the latest snapshot (200903172130), though the
error has changed somewhat:

/bin/sh /Users/graham/Development/php5.2-200903172130/libtool --silent
--preserve-dup-deps --mode=link gcc -O2 -I/usr/include
-I/nexopia/include  -rpath
/Users/graham/Development/php5.2-200903172130/libs -avoid-version
-module  -L/nexopia/lib  ext/libxml/libxml.lo
ext/pcre/pcrelib/pcre_chartables.lo ext/pcre/pcrelib/pcre_ucd.lo
ext/pcre/pcrelib/pcre_compile.lo ext/pcre/pcrelib/pcre_config.lo
ext/pcre/pcrelib/pcre_exec.lo ext/pcre/pcrelib/pcre_fullinfo.lo
ext/pcre/pcrelib/pcre_get.lo ext/pcre/pcrelib/pcre_globals.lo
ext/pcre/pcrelib/pcre_info.lo ext/pcre/pcrelib/pcre_maketables.lo
ext/pcre/pcrelib/pcre_newline.lo ext/pcre/pcrelib/pcre_ord2utf8.lo
ext/pcre/pcrelib/pcre_refcount.lo ext/pcre/pcrelib/pcre_study.lo
ext/pcre/pcrelib/pcre_tables.lo ext/pcre/pcrelib/pcre_try_flipped.lo
ext/pcre/pcrelib/pcre_valid_utf8.lo ext/pcre/pcrelib/pcre_version.lo
ext/pcre/pcrelib/pcre_xclass.lo ext/pcre/php_pcre.lo ext/ctype/ctype.lo
ext/date/php_date.lo ext/date/lib/astro.lo ext/date/lib/dow.lo
ext/date/lib/parse_date.lo ext/date/lib/parse_tz.lo
ext/date/lib/timelib.lo ext/date/lib/tm2unixtime.lo
ext/date/lib/unixtime2tm.lo ext/dom/php_dom.lo ext/dom/attr.lo
ext/dom/document.lo ext/dom/domerrorhandler.lo ext/dom/domstringlist.lo
ext/dom/domexception.lo ext/dom/namelist.lo
ext/dom/processinginstruction.lo ext/dom/cdatasection.lo
ext/dom/documentfragment.lo ext/dom/domimplementation.lo
ext/dom/element.lo ext/dom/node.lo ext/dom/string_extend.lo
ext/dom/characterdata.lo ext/dom/documenttype.lo
ext/dom/domimplementationlist.lo ext/dom/entity.lo ext/dom/nodelist.lo
ext/dom/text.lo ext/dom/comment.lo ext/dom/domconfiguration.lo
ext/dom/domimplementationsource.lo ext/dom/entityreference.lo
ext/dom/notation.lo ext/dom/xpath.lo ext/dom/dom_iterators.lo
ext/dom/typeinfo.lo ext/dom/domerror.lo ext/dom/domlocator.lo
ext/dom/namednodemap.lo ext/dom/userdatahandler.lo ext/filter/filter.lo
ext/filter/sanitizing_filters.lo ext/filter/logical_filters.lo
ext/filter/callback_filter.lo ext/hash/hash.lo ext/hash/hash_md.lo
ext/hash/hash_sha.lo ext/hash/hash_ripemd.lo ext/hash/hash_haval.lo
ext/hash/hash_tiger.lo ext/hash/hash_gost.lo ext/hash/hash_snefru.lo
ext/hash/hash_whirlpool.lo ext/hash/hash_adler32.lo
ext/hash/hash_crc32.lo ext/iconv/iconv.lo ext/json/json.lo
ext/json/utf8_to_utf16.lo ext/json/utf8_decode.lo
ext/json/JSON_parser.lo ext/pdo/pdo.lo ext/pdo/pdo_dbh.lo
ext/pdo/pdo_stmt.lo ext/pdo/pdo_sql_parser.lo ext/pdo/pdo_sqlstate.lo
ext/pdo_sqlite/pdo_sqlite.lo ext/pdo_sqlite/sqlite_driver.lo
ext/pdo_sqlite/sqlite_statement.lo ext/pdo_sqlite/sqlite/src/attach.lo
ext/pdo_sqlite/sqlite/src/auth.lo ext/pdo_sqlite/sqlite/src/btree.lo
ext/pdo_sqlite/sqlite/src/build.lo ext/pdo_sqlite/sqlite/src/callback.lo
ext/pdo_sqlite/sqlite/src/date.lo ext/pdo_sqlite/sqlite/src/delete.lo
ext/pdo_sqlite/sqlite/src/expr.lo ext/pdo_sqlite/sqlite/src/func.lo
ext/pdo_sqlite/sqlite/src/hash.lo ext/pdo_sqlite/sqlite/src/insert.lo
ext/pdo_sqlite/sqlite/src/legacy.lo ext/pdo_sqlite/sqlite/src/main.lo
ext/pdo_sqlite/sqlite/src/os_unix.lo ext/pdo_sqlite/sqlite/src/os_win.lo
ext/pdo_sqlite/sqlite/src/os.lo ext/pdo_sqlite/sqlite/src/pager.lo
ext/pdo_sqlite/sqlite/src/pragma.lo ext/pdo_sqlite/sqlite/src/prepare.lo
ext/pdo_sqlite/sqlite/src/printf.lo ext/pdo_sqlite/sqlite/src/random.lo
ext/pdo_sqlite/sqlite/src/select.lo ext/pdo_sqlite/sqlite/src/table.lo
ext/pdo_sqlite/sqlite/src/tokenize.lo
ext/pdo_sqlite/sqlite/src/analyze.lo
ext/pdo_sqlite/sqlite/src/complete.lo
ext/pdo_sqlite/sqlite/src/trigger.lo ext/pdo_sqlite/sqlite/src/update.lo
ext/pdo_sqlite/sqlite/src/utf.lo ext/pdo_sqlite/sqlite/src/util.lo
ext/pdo_sqlite/sqlite/src/vacuum.lo ext/pdo_sqlite/sqlite/src/vdbeapi.lo
ext/pdo_sqlite/sqlite/src/vdbeaux.lo ext/pdo_sqlite/sqlite/src/vdbe.lo
ext/pdo_sqlite/sqlite/src/vdbemem.lo ext/pdo_sqlite/sqlite/src/where.lo
ext/pdo_sqlite/sqlite/src/parse.lo ext/pdo_sqlite/sqlite/src/opcodes.lo
ext/pdo_sqlite/sqlite/src/alter.lo ext/pdo_sqlite/sqlite/src/vdbefifo.lo
ext/pdo_sqlite/sqlite/src/vtab.lo ext/pdo_sqlite/sqlite/src/loadext.lo
ext/posix/posix.lo ext/reflection/php_reflection.lo
ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo
ext/session/mod_user.lo ext/simplexml/simplexml.lo ext/spl/php_spl.lo
ext/spl/spl_functions.lo ext/spl/spl_engine.lo ext/spl/spl_iterators.lo
ext/spl/spl_array.lo ext/spl/spl_directory.lo ext/spl/spl_sxe.lo
ext/spl/spl_exceptions.lo ext/spl/spl_observer.lo ext/sqlite/sqlite.lo
ext/sqlite/sess_sqlite.lo ext/sqlite/pdo_sqlite2.lo
ext/sqlite/libsqlite/src/opcodes.lo ext/sqlite/libsqlite/src/parse.lo
ext/sqlite/libsqlite/src/encode.lo ext/sqlite/libsqlite/src/auth.lo
ext/sqlite/libsqlite/src/btree.lo ext/sqlite/libsqlite/src/build.lo
ext/sqlite/libsqlite/src/delete.lo ext/sqlite/libsqlite/src/expr.lo
ext/sqlite/libsqlite/src/func.lo ext/sqlite/libsqlite/src/hash.lo
ext/sqlite/libsqlite/src/insert.lo ext/sqlite/libsqlite/src/main.lo
ext/sqlite/libsqlite/src/os.lo ext/sqlite/libsqlite/src/pager.lo
ext/sqlite/libsqlite/src/printf.lo ext/sqlite/libsqlite/src/random.lo
ext/sqlite/libsqlite/src/select.lo ext/sqlite/libsqlite/src/table.lo
ext/sqlite/libsqlite/src/tokenize.lo ext/sqlite/libsqlite/src/update.lo
ext/sqlite/libsqlite/src/util.lo ext/sqlite/libsqlite/src/vdbe.lo
ext/sqlite/libsqlite/src/attach.lo ext/sqlite/libsqlite/src/btree_rb.lo
ext/sqlite/libsqlite/src/pragma.lo ext/sqlite/libsqlite/src/vacuum.lo
ext/sqlite/libsqlite/src/copy.lo ext/sqlite/libsqlite/src/vdbeaux.lo
ext/sqlite/libsqlite/src/date.lo ext/sqlite/libsqlite/src/where.lo
ext/sqlite/libsqlite/src/trigger.lo regex/regcomp.lo regex/regexec.lo
regex/regerror.lo regex/regfree.lo ext/standard/array.lo
ext/standard/base64.lo ext/standard/basic_functions.lo
ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo
ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo
ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo
ext/standard/file.lo ext/standard/filestat.lo
ext/standard/flock_compat.lo ext/standard/formatted_print.lo
ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo
ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo
ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo
ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo
ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo
ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo
ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo
ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo
ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo
ext/standard/versioning.lo ext/standard/assert.lo
ext/standard/strnatcmp.lo ext/standard/levenshtein.lo
ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo
ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo
ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo
ext/standard/css.lo ext/standard/var_unserializer.lo
ext/standard/ftok.lo ext/standard/sha1.lo ext/standard/user_filters.lo
ext/standard/uuencode.lo ext/standard/filters.lo
ext/standard/proc_open.lo ext/standard/streamsfuncs.lo
ext/standard/http.lo ext/tokenizer/tokenizer.lo
ext/tokenizer/tokenizer_data.lo ext/xml/xml.lo ext/xml/compat.lo
ext/xmlreader/php_xmlreader.lo ext/xmlwriter/php_xmlwriter.lo
TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo
main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo
main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo
main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo
main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo
main/php_variables.lo main/php_ticks.lo main/network.lo
main/php_open_temporary_file.lo main/php_logos.lo main/output.lo
main/streams/streams.lo main/streams/cast.lo main/streams/memory.lo
main/streams/filter.lo main/streams/plain_wrapper.lo
main/streams/userspace.lo main/streams/transports.lo
main/streams/xp_socket.lo main/streams/mmap.lo
Zend/zend_language_parser.lo Zend/zend_language_scanner.lo
Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo
Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo
Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo
Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo
Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo
Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo
Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo
Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo
Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo
Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo
Zend/zend_objects.lo Zend/zend_object_handlers.lo
Zend/zend_objects_API.lo Zend/zend_default_classes.lo
Zend/zend_execute.lo sapi/embed/php_embed.lo main/internal_functions.lo
-liconv -liconv -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm
-lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore
-lm -lxml2 -lz -licucore -lm  -o libphp5.la
ld: duplicate symbol _yytext in Zend/.libs/zend_ini_scanner.o and
Zend/.libs/zend_language_scanner.o

------------------------------------------------------------------------

[2008-11-04 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2008-10-27 13:37:34] [email protected]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[2008-04-25 17:56:46] cthompson at nexopia dot com

I just sent the following to the php-install mailing list for
feedback.

Modify php-5.2.5/Zend/zend_ini_scanner.c:

--- /Users/cthompson/php-5.2.5.clean/Zend/zend_ini_scanner.c   
2007-11-08 09:36:37.000000000 -0600
+++ ./zend_ini_scanner.c    2008-04-25 10:16:27.000000000 -0600
@@ -478,7 +478,7 @@
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+//char *yytext;
 #define INITIAL 0
 /*

+----------------------------------------------------------------------+


Modify php-5.2.5/Zend/zend_language_scanner.c:
--- /Users/cthompson/php-5.2.5.clean/Zend/zend_language_scanner.c
2007-11-08 09:36:37.000000000 -0600
+++ ./zend_language_scanner.c    2008-04-25 10:17:15.000000000 -0600
@@ -3009,7 +3009,7 @@
 #define yymore() (yy_more_flag = 1)
 #define YY_MORE_ADJ yy_more_len
 #define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+//char *yytext;
 #define INITIAL 0

 /*


This REMOVES the definition of yytext.  I think this is okay because
the various defines in those files actually end up using the yy_text in
zend_global.h, at least as far as I can see.

Certainly, this allows PHP to compile but I am not at all sure if this
is going to cause other problems.  Could someone please give me some
feedback?


Additionally, I believe php-5.2.5/sapi/cli/config.m4 should be modified
to compile using libtool on OS X:
--- /Users/cthompson/php-5.2.5.clean/sapi/cli/config.m4    2007-07-11
17:20:36.000000000 -0600
+++ ./config.m4    2008-04-25 11:51:57.000000000 -0600
@@ -17,7 +17,7 @@
     BUILD_CLI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg
\`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed
's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") ||
(\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) {
print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC)
-export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym
\$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
     ;;
   *darwin*)
-    BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS)
\$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
+    BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) \$(CFLAGS_CLEAN)
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
     ;;
   *netware*)
     BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic
\$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS)
\$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS)
-Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)"


Of course, the shipping version of PHP 5.2.5 would then also need the
php-5.2.5/configure file changing, though presumably this is
autogenerated from the fragments:
--- /Users/cthompson/php-5.2.5.clean/configure    2007-11-08
09:36:28.000000000 -0600
+++ ./configure    2008-04-25 11:27:46.000000000 -0600
@@ -9180,7 +9180,7 @@
     BUILD_CLI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg
\`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed
's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") ||
(\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) {
print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC)
-export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym
\$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
     ;;
   *darwin*)
-    BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS)
\$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
+    BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) \$(CFLAGS_CLEAN)
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS)
\$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS)
\$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
     ;;
   *netware*)
     BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic
\$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS)
\$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS)
-Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)"



Again, I really welcome feedback on this.

------------------------------------------------------------------------

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
    http://bugs.php.net/44462

-- 
Edit this bug report at http://bugs.php.net/?id=44462&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.