php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14483 -twolevel_namespace and multiple definitions errors
Submitted: 2001-12-13 07:08 UTC Modified: 2002-09-24 17:36 UTC
Votes:21
Avg. Score:5.0 ± 0.0
Reproduced:19 of 19 (100.0%)
Same Version:6 (31.6%)
Same OS:10 (52.6%)
From: abner at criticalnexus dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.2.0-dev OS: Mac OS X 10.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: abner at criticalnexus dot com
New email:
PHP Version: OS:

 

 [2001-12-13 07:08 UTC] abner at criticalnexus dot com
(NOTE: Duplicate of BUG 14256)

PHP 4.1.0 fails to compile on Mac OS X 10.1 (you probably already know this).  This is while building the Apache Module.

Notes:
- First scenario: attempting the run-of-the-mill compile fails once it gets to ld, which throws out "-twolevel_namespace" warnings.
- Second scenario: Modifying (by adding "-flat_namespace") any presence of anything that may seem like a compiler flag or linker flag in config_vars.mk, php_config.h, libtool, etc., leads to a LARGE number of multiple definition errors that look like this:
-----------
TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in section (__TEXT,__text)
TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in section (__TEXT,__text) 
------------

These errors flow in large quantities (in pairs like above), right at the end of the compile.  The section (__TEXT,__text) part is always the same, but "(foo.lo)" changes to what seems to be EVERY symbol that was compiled.


- Have downloaded latest snap from PHP.net (13 Dec 2001), and it still fails.
-Tried using latest libtool from GNU.org (1.4.2), with the same result.
-It seems like others are experiencing either of the scenarios above... since most people know about the "-flat_namespace" flag, the try to deal, only to end up with the large quantities of multiple symbol errors.

Hmm...

-Abner

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-13 07:18 UTC] abner at criticalnexus dot com
Also a duplicate of bug 14154, which is a freakin' struggle of a bug.
 [2002-01-08 15:47 UTC] abner at criticalnexus dot com
A solution, that works, for now:

Thanks to http://www.entropy.ch/software/macosx/php/ (Marc Liyanage).

---------

NOTE 2: I was not able to get the build for PHP 4.1.0 to work correctly, probably because of libtool issues. A helpful developer suggested

- running configure in the PHP 4.0.6 source tree 
- modifying the resulting libtool script 
- then configuring the PHP 4.1.0 sources 
- copying the modified 4.0.6 libtool over to the 4.1.0 directory 
- and finally running make 

This did the trick for me. Here's the line that needs to be changed in the 4.0.6 libtool script:

old: archive_cmds="\$CC -bundle -undefined suppress -o \$lib \$libobjs \$deplibs \$linkopts"

new: archive_cmds="\$CC -flat_namespace -bundle -undefined suppress -o \$lib \$libobjs \$deplibs \$linkopts"

--------- END

Hopefully this will help passers-by looking for assistance.  It seems like the old libtool (1.3.5?) was OK (except for the -flat_namespace thing).  It's this 1.4.2 that has caused the headache...

I have PHP 4.1.1 working using this shenanigan.  No more typing HTTP_POST_VARS and gratuitous global declarations!  Bruhuhahaha...

Oh yeah, I can also say that bug ID 10686 (in datetime.c) has been fixed and that behavior no longer appears in the mktime function... Booyah... (http://bugs.php.net/bug.php?id=10686)

 [2002-01-30 15:26 UTC] kalowsky@php.net
just one detail question here, can you please include a copy of your configure options as well?
 [2002-01-30 17:11 UTC] abner at criticalnexus dot com
For the apache module, I use...

./configure --with-apxs --with-mysql
 [2002-02-10 08:45 UTC] stefano at apache dot org
Ok, 

here is how I got PHP-4.1.1 to compile clean on MacOSX 10.1.4 for Apache 1.3.22 with APXS:

1) download 4.0.6 and run ./configure --with-apxs --with-[your stuff here]

2) download 4.1.1 and run ./configure --with-apxs --with-[your stuff here]

3) copy php-4.0.6/libtool to php-4.1.1/libtool

4) open php-4.1.1/libtook, go to line 178 and add  the '-flat-namespace' directive to the compiler, so change

  archive_cmds="\$CC -bundle [...]

with 

  archive_cmds="\$CC -flat_namespace -bundle [...]

5) open php-4.1.1/Zend/zend_language_scanner.c, go to line 2725 and comment that line out, so change

 char *yytext;

with 

 /* char *yytext; */

[don't worry, this is already defined in another file so this doesn't appear to break anything]

6) run 'make'

7) run 'make install'

8) run 'apachectl restart'

and you are up and running :)
 [2002-03-10 12:53 UTC] markonen@php.net
This bug has been superceded by bugs 15986 and 15987. 
Please follow those bugs for information regarding the 
forthcoming fixes for the issue you've reported.
 [2002-04-10 18:47 UTC] sniper@php.net
This is fixed in CVS.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Mar 11 19:01:31 2025 UTC