Bug 82024 - lang/php5 doesn't compile out of the box.
Summary: lang/php5 doesn't compile out of the box.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-08 11:40 UTC by Edwin Culp
Modified: 2005-07-01 10:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edwin Culp 2005-06-08 11:40:04 UTC
      lang/php5 hasn't compiled "out of the box" for some time.  It generates the following error messages:
 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_mm.lo Zend/zend_default_classes.lo Zend/zend_reflection_api.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lbind -lcrypt -lm -lxml2 -lz -liconv -lm -lcrypt -lcrypt  -o sapi/cli/php
ext/standard/dns.lo(.text+0x131f): In function `zif_dns_get_record':
: undefined reference to `res_ninit'
ext/standard/dns.lo(.text+0x1365): In function `zif_dns_get_record':
: undefined reference to `res_nmkquery'
ext/standard/dns.lo(.text+0x138d): In function `zif_dns_get_record':
: undefined reference to `res_nsend'
ext/standard/dns.lo(.text+0x148f): In function `zif_dns_get_record':
: undefined reference to `res_nclose'
*** Error code 1

Stop in /usr/ports/lang/php5/work/php-5.0.4.
*** Error code 1

Fix: At least the following patch submitted to the list by Bjoern Koenig <bkoenig@cs.tu-berlin.de> works very well for me on 5 different servers for over a week.



-        i = res_search(Z_STRVAL_PP(arg1), C_IN, type, ans, sizeof(ans));
+        i = __res_search(Z_STRVAL_PP(arg1), C_IN, type, ans, sizeof(ans));

         if (i < 0) {
                 RETURN_FALSE;
@@ -627,17 +627,17 @@
                                 break;
                 }
                 if (type_to_fetch) {
-                        res_ninit(&res);
+                        __res_ninit(&res);
                         res.retrans = 5;
                         res.options &= ~RES_DEFNAMES;

-                        n = res_nmkquery(&res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, sizeof
 buf);
+                        n = __res_nmkquery(&res, QUERY, Z_STRVAL_P(host), C_IN, type_to_fetch, NULL, 0, NULL, buf.qb2, size
of buf);
                         if (n<0) {
                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "res_nmkquery() failed");
                                 zval_dtor(return_value);
                                 RETURN_FALSE;
                         }
-                        n = res_nsend(&res, buf.qb2, n, answer.qb2, sizeof answer);
+                        n = __res_nsend(&res, buf.qb2, n, answer.qb2, sizeof answer);
                         if (n<0) {
                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "res_nsend() failed");
                                 zval_dtor(return_value);
@@ -673,7 +673,7 @@
                                         add_next_index_zval(return_value, retval);
                                 }
                         }
-                        res_nclose(&res);
+                        __res_nclose(&res);
                 }
         }

@@ -741,7 +741,7 @@
         array_init(mx_list);

         /* Go! */
-        i = res_search(Z_STRVAL_P(host), C_IN, T_MX, (u_char *)&ans, sizeof(ans));
+        i = __res_search(Z_STRVAL_P(host), C_IN, T_MX, (u_char *)&ans, sizeof(ans));
         if (i < 0) {
                 RETURN_FALSE;
         }--KlfxT5CNs0yAKsXdwZfsHAMhcNPpdLjk8szlrViMJtg62tMh
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- ext/standard/dns.c.bak        Mon May 23 14:32:16 2005
+++ ext/standard/dns.c        Mon May 23 14:33:18 2005
@@ -254,7 +254,7 @@
                         WRONG_PARAM_COUNT;
         }
How-To-Repeat:       cd /usr/ports/lang/php5
      make
Comment 1 Vasil Dimov 2005-06-08 15:36:12 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Jun 08, 2005 at 10:33:04AM +0000, Edwin Culp wrote:
...
>       lang/php5 hasn't compiled "out of the box" for some time.  It generates the following error messages:
>  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/ze nd_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_mm.lo Zend/zend_default_classes.lo Zend/zend_reflection_api.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lbind -lcrypt -lm -lxml2 -lz -liconv -lm -lcrypt -lcrypt  -o sapi/cli/php
> ext/standard/dns.lo(.text+0x131f): In function `zif_dns_get_record':
> : undefined reference to `res_ninit'
> ext/standard/dns.lo(.text+0x1365): In function `zif_dns_get_record':
> : undefined reference to `res_nmkquery'
> ext/standard/dns.lo(.text+0x138d): In function `zif_dns_get_record':
> : undefined reference to `res_nsend'
> ext/standard/dns.lo(.text+0x148f): In function `zif_dns_get_record':
> : undefined reference to `res_nclose'
> *** Error code 1
> 
> Stop in /usr/ports/lang/php5/work/php-5.0.4.
> *** Error code 1

Compiles without problems here:

% uname -a
FreeBSD sinanica.bg.datamax 5.4-STABLE FreeBSD 5.4-STABLE #6: Tue May 10 12:46:25 EEST 2005     root@sinanica.bg.datamax:/usr/obj/usr/src/sys/SINANICA-SMP  i386

/usr/ports/lang/php5% make -V PKGNAME
php5-5.0.4_2

% ls /var/db/pkg
BillardGL-1.75_1
ORBit-0.5.17_2
ORBit2-2.12.2
Sablot-1.0.1
aalib-1.4.r5_1
acroread-5.10_1,1
acroread7-7.0.0
apache-1.3.33_1
apache-ant-1.6.2
apg-2.3.0b
argouml-0.16.1
atk-1.9.1
autoconf-2.13.000227_5
autoconf-2.53_3
autoconf-2.59_2
automake-1.9.5
bash-3.0.16_1
bedic-data-0.1.b1
bison-1.75_2
bitstream-vera-1.10_1
boehm-gc-6.4
bonnie-2.0.6
bonobo-1.0.22_1
c2html-0.9.2
catdoc-0.93.4
cbedic-1.2_2
cdparanoia-3.9.8_7
cdrtools-2.01
clibpdf-2.02.r1
cmdwatch-0.2.0
cpuburn-1.4
cpuid-3.3_1
cracklib-2.7_2
ctorrent-1.3.4
cups-base-1.1.23.0_4
cups-lpr-1.1.23.0
cups-pstoraster-7.07_3
cvsbook-1.21_2
cvsup-without-gui-16.1h_2
dar-2.2.2
db3-3.3.11_2,1
db41-4.1.25_3
desktop-file-utils-0.10_2
dia-gnome-0.94_2,1
diacanvas2-0.14.1_1
dict-1.9.15
djvulibre-3.5.14_1
docbook-1.3
docbook-241_2
docbook-3.0_2
docbook-3.1_2
docbook-4.0_2
docbook-4.1_2
docbook-sk-4.1.2_3
docbook-xml-4.2_1
docbook-xsl-1.68.1
docproj-nojadetex-1.13
dpkg-1.9.21_2
dri-6.2.1,2
dsssl-docbook-modular-1.79,1
entropy-2.0
eps2png-1.7_1
esound-0.2.36
expat-1.95.8_2
ezm3-1.2
fam-2.6.9_6
fetchmail-6.2.5_2
fftw-2.1.5_2
firefox-1.0.4,1
flowdesigner-0.8.2_2
fontconfig-2.2.3,1
foobillard-2.9_1
freeglut-2.2.0
freetype2-2.1.9
gail-1.8.4
gawk-3.1.1_1
gcc-2.95.3_2
gconf-1.0.9_7
gconf2-2.10.0
gd-2.0.33_1,1
gdbm-1.8.3_1
gdk-pixbuf-0.22.0_3
gettext-0.14.4_1
ghostscript-gnu-7.07_12
gimp-1.2.5_1,1
gimp-print-4.2.7_1
glib-1.2.10_11
glib-2.6.4
gmake-3.80_2
gnome-icon-theme-2.10.1_1
gnome-menus-2.10.1_1
gnomecanvas-0.22.0_3
gnomedb-0.2.96_2
gnomedesktop-2.10.1
gnomehier-2.0_6
gnomekeyring-0.4.2_1
gnomelibs-1.4.2_3
gnomemimedata-2.4.2
gnomepanel-2.10.1_1
gnomeprint-0.37_1
gnomevfs2-2.10.1
gnupg-1.4.1
gnutls-1.0.24_1
grub-0.97
gsfonts-8.11_2
gtk-1.2.10_13
gtk-2.6.7
gtk-engines2-2.6.3_3
gtkglarea-1.2.3
guile-1.6.5
help2man-1.35.1
hexedit-1.2.1
hicolor-icon-theme-0.5
html-4.01_2
icewm-gnome-1.2.21
iftop-0.16
imake-6.8.2
imlib-1.9.15_2
intltool-0.33
iso8879-1986_2
ispell-3.2.06_13
jade-1.2.1_9
jam-2.5_2
javavmwrapper-2.0_4
jbigkit-1.6
jdk-1.4.2p7_1
john-1.6.37_1
jpeg-6b_3
lame-3.96.1
lcms-1.14,1
libIDL-0.8.5_1
libXft-2.1.6_1
libart_lgpl2-2.3.17
libaudiofile-0.2.6
libbonobo-2.8.1_1
libbonoboui-2.8.1_2
libcroco-0.6.0_1
libdnet-1.10
libflash-0.4.13
libgcrypt-1.2.1_1
libgda-0.2.96_2
libglade-0.17_3
libglade2-2.5.1_2
libglut-6.0.1
libgnome-2.10.0_1
libgnomecanvas-2.10.2_1
libgnomecups-0.2.0_1,1
libgnomeprint-2.10.3_1
libgnomeprintui-2.10.2
libgnomeui-2.10.0_1
libgnugetopt-1.2
libgpg-error-1.0_1
libgsf-1.11.1
libgtkhtml-2.6.3_1
libiconv-1.9.2_1
libijs-0.35
libltdl-1.5.10
libmad-0.15.1b_1
libmng-1.0.8
libnet-1.0.2a,1
libogg-1.1.2_1,3
libpcapnav-0.5
librsvg2-2.9.5_2
libsidplay-1.36.59
libsigc++-2.0.12
libslang-1.4.9
libtool-1.3.5_2
libtool-1.5.10_1
libtorrent-0.6.2
libungif-4.1.3
libvorbis-1.1.0_1,3
libwnck-2.10.0
libxml-1.8.17_3
libxml2-2.6.19
libxslt-1.1.14
libzvt-2.0.1_10
linc-1.0.3_3
links-0.98,1
linux-atk-1.2.0_2
linux-expat-1.95.5_2
linux-flashplugin-6.0r79_2
linux-flashplugin-7.0r25_1
linux-fontconfig-2.1_2
linux-glib2-2.2.1_2
linux-jpeg-6b.15_3
linux-png-1.2.7_5
linux-realplayer-10.0.4
linux-sun-jdk-1.4.2.08_1
linux-tiff-3.6.1_1
linux_base-debian-3.0.23_1
linuxdoc-1.1_1
linuxpluginwrapper-20050320
lsof-4.75
lzo-1.08_1,1
m4-1.4.3
maildrop-1.8.0_3
memtest-4.0.5
mhash-0.9.2
micq-0.5.0.3
mime-support-3.34.1
mkcatalog-1.1
mozilla-1.7.8,2
mp3blaster-3.2.0_2
mpack-1.5_3
mpg123-esound-0.59r_17
mplayer-gtk-esound-0.99.7_4
mplayer-skins-1.1.1_2
mutt-devel-1.5.9_2
mysql-client-3.23.59.n.20050301_1
mysql-server-3.23.59.n.20050301_1
nas-1.7
nasm-0.98.39,1
nat-20
net-snmp-5.2.1_2
netcat-1.10_2
netcdf-3.6.0p1
netmask-2.4_1
netpbm-10.26.10
netpipes-4.2
ngrep-1.43
nmap-3.81
nspr-4.4.1_1
nullmailer-1.00,1
nvidia-driver-1.0.7174
oaf-0.6.10_2
open-motif-2.2.3_2
openal-20050401
openldap-client-2.1.30
openvpn-2.0_3
ossp-ex-1.0.4
ossp-sa-1.2.4
p5-Astro-MoonPhase-0.52
p5-Digest-1.10
p5-Digest-MD5-2.33
p5-File-Spec-0.90
p5-File-Temp-0.16_1
p5-MIME-Base64-3.05
p5-Net-Pcap-0.05
p5-NetPacket-0.04
p5-ReadLine-Gnu-1.14
p5-Test-Harness-2.42
p5-Test-Simple-0.60
p5-XML-Parser-2.34_1
p5-gettext-1.03
panda-0.5.4
pango-1.8.1
pccts-1.33.33
pcre-5.0
perl-5.6.2_2
php4-cgi-4.3.11_1
physfs-1.0.0
pkgconfig-0.17.2
pkgdb.db
pkgdb.fixme
plib-1.8.4
pmk-0.9.2
png-1.2.8_2
popt-1.7
portaudit-0.5.9
portlint-2.7.1_1
portupgrade-20041226_4
postgresql-client-7.4.8
postgresql-docs-7.4.8
postgresql-server-7.4.8
psmisc-17
publib-0.38
py24-BitTorrent-4.0.2,1
py24-gnome-2.10.0
py24-gtk-2.6.2
py24-numeric-23.7
py24-orbit-2.0.1_1
py24-psyco-1.4
python-2.4.1_1
qmake-3.3.4
qt-3.3.4
rblcheck-1.5_2
rlwrap-0.21
rman-3.2
rpm-3.0.6_10
rpm2cpio-1.2_2
ruby-1.8.2_3
ruby18-bdb1-0.2.2
rzip-2.0
samba-3.0.14a,1
scmxx-0.7.5
scr2png-1.1_4
scr2txt-1.1
screen-4.0.2_1
scrollkeeper-0.3.14_1,1
sdl-1.2.8,2
sdl_image-1.2.4
sdl_mixer-1.2.6
sdocbook-xml-4.1.2.5_2
seejpeg-1.10_2
sgmlformat-1.7_2
shared-mime-info-0.16_1
smpeg-0.4.4_3
socket-1.1_1
sp-1.3.4
startup-notification-0.8_1
strace-4.5.1_1
stunnel-4.10_1
svgalib-1.4.3_4
t1lib-5.0.1,1
tcl-8.3.5_5
tcpslice-2002.04.15
tcptraceroute-1.4
tidy-20000804_2
tiff-3.7.2
tiff2png-0.91,1
torcs-1.2.3
trigger-0.5.1c
ucspi-tcp-0.88_1
ucspi-unix-0.36_3
unix2dos-1.3
unrar-3.43,3
unzip-5.52_1
urwfonts-1.0
vicq-0.4.1
vim-6.3.62
vlock-1.3
vnc-4.1.1
w3m-0.5.1
weblint-1.020
win32-codecs-3.1.0.p5_1,1
xfstt-1.6
xhtml-1.0.20020801_4
xmbmon-205_1
xmlcatmgr-2.2
xnview-1.68
xorg-clients-6.8.2
xorg-documents-6.8.2
xorg-fonts-100dpi-6.8.2
xorg-fonts-75dpi-6.8.2
xorg-fonts-cyrillic-6.8.2
xorg-fonts-encodings-6.8.2
xorg-fonts-miscbitmaps-6.8.2
xorg-fonts-truetype-6.8.2
xorg-fonts-type1-6.8.2
xorg-fontserver-6.8.2
xorg-libraries-6.8.2
xorg-nestserver-6.8.2
xorg-printserver-6.8.2
xorg-server-6.8.2_2
xorg-vfbserver-6.8.2
xpdf-3.00_6
xterm-202
zip-2.3_2
-----BEGIN PGP SIGNATURE-----

iD8DBQFCpwJcFw6SP/bBpCARAnZLAKC1etJqOMKKfO+AK+okmRESqu8D4QCgk63/
H3pkgvKbvgWK5p2h638cNoo=
=fe03
-----END PGP SIGNATURE-----
Comment 2 Patrick Li freebsd_committer freebsd_triage 2005-06-10 09:20:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to ale(maintainer)
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2005-06-14 15:18:21 UTC
State Changed
From-To: open->feedback

What bind library are you using? Have you installed a bind port?
Comment 4 Björn König 2005-06-18 23:37:48 UTC
Hello,

Most likely an installed libbind is the reason for this problem. I had 
the same problem with PHP in conjunction with a world that was compiled 
with WITH_BIND_LIBS=yes. The problem is that the configure script of PHP 
detects the availability of __res_ninit and friends, but assumes that 
proper headers are included that #define res_ninit __res_ninit and so 
on. PHP tries to use res_ninit regardless of the absence of this header 
file. I (and others too) asked the PHP developers already to change this 
behaviour, but they don't want to. I hope these information help you.

I have two quick and dirty patches that are *untested* and mutually 
exclusive:


--- patch-ext::standard::dns.h-1 begins here ---
--- ext/standard/dns.h       Sun Jun 19 00:24:48 2005
+++ ext/standard/dns.h.bkoenig-1     Sun Jun 19 00:27:49 2005
@@ -25,6 +25,10 @@

  #if HAVE_RES_NMKQUERY && HAVE_RES_NSEND && HAVE_DN_EXPAND && 
HAVE_DN_SKIPNAME
  #define HAVE_DNS_FUNCS 1
+#define res_ninit __res_ninit
+#define res_nmkquery __res_nmkquery
+#define res_nsend __res_nsend
+#define res_nclose __res_nclose
  #endif

  PHP_FUNCTION(gethostbyaddr);
--- patch-ext::standard::dns.h-1 ends here ---



--- patch-ext::standard::dns.h-2 begins here ---
--- ext/standard/dns.h       Sun Jun 19 00:24:48 2005
+++ ext/standard/dns.h.bkoenig-2     Sun Jun 19 00:28:13 2005
@@ -26,6 +26,7 @@
  #if HAVE_RES_NMKQUERY && HAVE_RES_NSEND && HAVE_DN_EXPAND && 
HAVE_DN_SKIPNAME
  #define HAVE_DNS_FUNCS 1
  #endif
+#undef HAVE_DNS_FUNCS

  PHP_FUNCTION(gethostbyaddr);
  PHP_FUNCTION(gethostbyname);
--- patch-ext::standard::dns.h-2 ends here ---



Björn
Comment 5 Alex Dupre freebsd_committer freebsd_triage 2005-06-19 11:12:29 UTC
State Changed
From-To: feedback->closed

Fix committed, thanks!
Comment 6 Björn König 2005-07-01 09:53:39 UTC
Hello,

the commited patch patch-ext_standard_dns.h has a little disadvantage 
now. PHP might depend on a library from a package that wasn't registered 
as dependency.

I'll submit a patch which deals with this issue in a few weeks.

Björn