V2EX
   Archive for:
 September, 2009
Posted in Mac, Programming on September 1st, 2009 by Xin

After upgraded to Snow Leopard, the first thing I noticed is that my MacPorts installation stopped working. It’s due to the architecture change, since almost everything in Snow Leopard now shifts to 64-bit, old 32-bit MacPorts is no longer working.

My local web development depends on MacPorts, I use MacPorts to install Apache 2.2 and compile my own PHP 5.3 since I need some special PHP modules. When I’m going to compile PHP 5.3 under 10.6, I got this at last stage:

Undefined symbols:
"_res_9_dn_expand", referenced from:
_php_parserr in dns.o
_php_parserr in dns.o
_php_parserr in dns.o
_php_parserr in dns.o
_php_parserr in dns.o
_php_parserr in dns.o
_php_parserr in dns.o
_zif_dns_get_mx in dns.o
"_res_9_search", referenced from:
_zif_dns_check_record in dns.o
_zif_dns_get_record in dns.o
_zif_dns_get_mx in dns.o
"_res_9_init", referenced from:
_zif_dns_check_record in dns.o
_zif_dns_get_record in dns.o
_zif_dns_get_mx in dns.o
"_res_9_dn_skipname", referenced from:
_zif_dns_get_record in dns.o
_zif_dns_get_mx in dns.o
_zif_dns_get_mx in dns.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

After some Google I found it’s fixed if you add this line in EXTRA_LIBS in Makefile:

-lresolv

I guess it’s a bug in PHP 5.3 branch. And another thing you’ll need to care is to replace your MySQL installation with a 64-bit one. Then everything is with 64-bit super force. :)