Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14523 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16703 invoked by uid 1010); 2 Feb 2005 13:43:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16688 invoked from network); 2 Feb 2005 13:43:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2005 13:43:27 -0000 X-Host-Fingerprint: 212.227.126.189 moutng.kundenserver.de Received: from ([212.227.126.189:50017] helo=moutng.kundenserver.de) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id 8A/54-11295-FF8D0024 for ; Wed, 02 Feb 2005 08:43:27 -0500 Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CwKmy-0001wr-00; Wed, 02 Feb 2005 14:43:24 +0100 Received: from [80.129.108.52] (helo=comsrv1.ADwin.JCM) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1CwKmy-0000vt-00; Wed, 02 Feb 2005 14:43:24 +0100 Received: from [10.10.101.12] by comsrv1.adwin.de (GMS 10.02.3270/LG0047.00.c5305bac) with ESMTP id yujacaaa for internals@lists.php.net; Wed, 2 Feb 2005 14:43:23 +0100 To: internals@lists.php.net Date: Wed, 2 Feb 2005 14:43:23 +0100 User-Agent: KMail/1.7.1 [via SMTPAuth 0.9, bisswanger.com] MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200502021443.23453.TBoehne@ADwin.de> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:f58f781878dbc4701f22ba7e74d5a143 Subject: library constructor not called from php extension From: TBoehne@ADwin.de (Thomas Boehne) Hello PHP developers,=20 I have a just written a PHP-Extension as described in the documentation. I am using PHP 4.3.10. Configure (--with-libadwin), compiling and linking work fine, this is what ldd shows (libadwin.so.4 is the function used by my extension): thomasb:~/php-4.3.10 1$ ldd ./sapi/cgi/php libcrypt.so.1 =3D> /lib/tls/libcrypt.so.1 (0xb7fa4000) libadwin.so.4 =3D> /usr/local/adwin//lib/libadwin.so.4 (0xb7f79000) libpthread.so.0 =3D> /lib/tls/libpthread.so.0 (0xb7f6a000) libresolv.so.2 =3D> /lib/tls/libresolv.so.2 (0xb7f58000) libm.so.6 =3D> /lib/tls/libm.so.6 (0xb7f36000) libdl.so.2 =3D> /lib/tls/libdl.so.2 (0xb7f33000) libnsl.so.1 =3D> /lib/tls/libnsl.so.1 (0xb7f1f000) libc.so.6 =3D> /lib/tls/libc.so.6 (0xb7dea000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0xb7fea000) Calling libadwin-functions does basically work from my php-extension, but the problem is that the library constructor of libadwin is not executed. I have never had such a problem with other programs that were linked against that library. The constructor in the library is defined like this: void __attribute__ ((constructor)) my_init(void) { My current workaround is to manually call the initialization functions, but for customer releases I must rely on the constructor being used. I am not sure if the problem exists in php5 as well, but I could check if someone is interested. Any ideas? Thomas =2D-=20 J=E4ger Computergesteuerte Messtechnik GmbH Thomas B=F6hne Rheinstra=DFe 2-4 64653 Lorsch Germany Phone: +49-6251-9632-0