Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mountain lion : 5.3.* compilation error #24

Closed
shouze opened this issue Sep 3, 2012 · 18 comments
Closed

mountain lion : 5.3.* compilation error #24

shouze opened this issue Sep 3, 2012 · 18 comments

Comments

@shouze
Copy link

shouze commented Sep 3, 2012

Hi,

I'm able to install php 5.4.* but can't install 5.3.*.
Seems to be a c++ and/or gettext concern.

I'm running mountain lion with the latest XCode version (4.4.1).
I have installed brew dependencies as notified in the Readme.

Here is my install command :

phpbrew install php-5.3.16 +default+dbs

Even 5.3.15 is not working.

The only thing I've made differently from Readme is linking gettext (brew link gettext) as if I don't make this link it's worse, I have an abort saying c++ compiler don't work at all :

Without brew link gettext

c++  -L/usr/lib  -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/icu4c/49.1.2/lib -L/usr/local/Cellar/icu4c/49.1.2/lib

Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

With brew link gettext

Undefined symbols for architecture x86_64:
  "Undefined symbols for architecture x86_64:
  "std::terminate()std::terminate()", referenced from:
      _umsg_parse_helper in msgformat_helpers.o
      _umsg_format_helper in msgformat_helpers.o
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in msgformat_helpers.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
", referenced from:
      _umsg_parse_helper in msgformat_helpers.o
      _umsg_format_helper in msgformat_helpers.o
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in msgformat_helpers.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
make: *** [sapi/cgi/php-cgi] Error 1

Any idea ? I've noticed than 5.4.* version are compiled against clang, 5.3.* with llvm-gcc.

@c9s
Copy link
Member

c9s commented Sep 3, 2012

it seems that you need 64bit lib for compiling gettext, but the 64bit library is not found. (when you link gettext)

In Mac OS, there is a binary format called univeral, Macports support this, but I don't know what the option corresponding to this on homebrew is.

@c9s
Copy link
Member

c9s commented Sep 3, 2012

Check this thread, hope this helps you.

http://librelist.com/browser//homebrew/2010/3/23/creating-universal-binaries-in-homebrew/#37df3230cdc60c89f92e78b71d0cc1d2

If it still doesn't work, try not to use gettext extension, use separate variants for your php, then use phpbrew install-ext gettext to build the gettext extension separately.

@c9s
Copy link
Member

c9s commented Sep 3, 2012

OK, I just got the same error:

/Users/c9s/.phpbrew/build/php-5.3.16/Zend/zend_objects.c: In function ‘zend_objects_destroy_object’:
/Users/c9s/.phpbrew/build/php-5.3.16/Zend/zend_objects.c:96: warning: assignment discards qualifiers from pointer target type

Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
_umsg_format_helper in msgformat_helpers.o
_umsg_parse_helper in msgformat_helpers.o
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for icu_48::UMemoryin msgformat_helpers.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"___gxx_personality_v0", referenced from:
_umsg_format_helper in msgformat_helpers.o
_umsg_parse_helper in msgformat_helpers.o
Dwarf Exception Unwind Info (__eh_frame) in msgformat_helpers.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

@c9s
Copy link
Member

c9s commented Sep 3, 2012

really strange because my gettext is compiled with "universal".

port installed gettext
The following ports are currently installed:
gettext @0.18.1.1_2
gettext @0.18.1.1_2+universal (active)

seems it needs to be fixed in PHP.

@shouze
Copy link
Author

shouze commented Sep 3, 2012

I've forced installation from source for icu4c & gettext but I only have x86_64 binaries.

I already have compiled few weeks ago php 5.3.15 with success on mountain lion (was on an iMac whereas I'm trying to compile on a MBA at the moment).

The only things that may have changed since are :

  • XCode version
  • phpbrew
  • I didn't had to install gettext at that time (is it an added requirement since last updates of phpbrew ?)

So I have tried to compile again on the iMac, same issue! php-5.3.15 & php-5.3.16 source code hasn't changed since, true ?

Son before investigating into XCode upgrade, do you know if a recent (1 mont max) change into phpbrew would produce such issue ?

@c9s
Copy link
Member

c9s commented Sep 4, 2012

I took off the --gettext options out from default, can you run self-update to get latest phpbrew for building ?

@c9s
Copy link
Member

c9s commented Sep 4, 2012

I think it might be caused by XCode, because I've built 5.3.* phps on Mac Lion. it works very well.

@shouze
Copy link
Author

shouze commented Sep 4, 2012

Ok thanks, I'll try in a little hour.

Le 4 sept. 2012 à 05:16, Yo-An Lin notifications@github.com a écrit :

I took off the --gettext options out from default, can you run self-update
to get latest phpbrew for building ?


Reply to this email directly or view it on
GitHubhttps://github.com//issues/24#issuecomment-8251404.

@c9s
Copy link
Member

c9s commented Sep 10, 2012

Hi @shouze,

did it solve your problem?

I just googled and found something,

https://bugs.php.net/bug.php?id=48795

Maybe it helps.

@c9s
Copy link
Member

c9s commented Mar 9, 2013

Found the solution, it's a bug of PHP source.

http://blog.gcos.me/2012-10-19_how-to-compile-php53-on-64bit-linux-macos.html

@c9s c9s closed this as completed Mar 9, 2013
@c9s
Copy link
Member

c9s commented Mar 9, 2013

We now have a built-in patch for building php 5.3.x , I just tested it on my Mac OS X, that should work. ;-)

@KonstantinKuklin
Copy link

I have such problem now, where is the patch?

@marcioAlmada
Copy link
Member

Patch is still functional, see here.

@KonstantinKuklin
Copy link

I tried to install 5 mins ago:

brew install php53
==> Downloading http://www.php.net/get/php-5.3.29.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php53-5.3.29
==> Patching
patching file configure
patching file configure.in
patching file Zend/zend_language_parser.y
patching file configure
patching file Zend/acinclude.m4
==> rm Zend/zend_{language,ini}_parser.[ch]
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
         of homebrew-php, or you are using a non-standard
         pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php53/5.3.29 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.3 --with-config-file-path=/usr/local/etc/php/5.3 --with-config-file-scan-dir=/usr
==> make
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/josegonzalez/homebrew-php/issues

@marcioAlmada
Copy link
Member

You're asking for help in the wrong place. This is phpbrew project, not homebrew.

Pleas go to https://github.com/josegonzalez/homebrew-php/issues or try phpbrew :)

@KonstantinKuklin
Copy link

😅 thx)

@marcioAlmada
Copy link
Member

lol

@phpbrew phpbrew locked and limited conversation to collaborators Sep 16, 2014
@c9s
Copy link
Member

c9s commented Oct 6, 2014

note: sed fix 9844bb7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants