php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41794 Library test for external sqlite3 misses -lrt and fails
Submitted: 2007-06-25 05:21 UTC Modified: 2007-06-25 16:26 UTC
From: geoffwa at cs dot rmit dot edu dot au Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.2.3 OS: Solaris 10
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: geoffwa at cs dot rmit dot edu dot au
New email:
PHP Version: OS:

 

 [2007-06-25 05:21 UTC] geoffwa at cs dot rmit dot edu dot au
Description:
------------
The library test for external SQLite3 libraries fails on Solaris 10
as it does not include -lrt and consequently always fails.

When building with bundled sqlite3 library, there is a test
for -lrt on line 122 of ext/pdo_sqlite/config.m4:

dnl Solaris fix
PHP_CHECK_LIBRARY(rt, fdatasync, [
   PHP_ADD_LIBRARY(rt,, PDO_SQLITE_SHARED_LIBADD)])

This test could be moved so it's usable by both the bundled and
non-bundled builds.

(I'd offer a patch but my M4 foo is weak)


Reproduce code:
---------------
shell:
./configure --prefix=/usr/local --with-pdo-sqlite=shared,/usr/local
*snip*
checking for sqlite 3 support for PDO... yes, shared
checking for PDO includes... (cached) /export/work/php-5.2.3/ext
checking for sqlite3_open in -lsqlite3... no
configure: error: wrong sqlite lib version or lib not found

config.log:
configure:76889: cc -o conftest -I/usr/include -O -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -R/usr/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/
lib -R/usr/local/lib  -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib -L/usr/local/lib -lm conftest.c -lsqlite3  -lintl -lbz2 -lz -lpcre -lresolv -lm -lnsl -ls
ocket  -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
Undefined                       first referenced
 symbol                             in file
fdatasync                           /usr/local/lib/libsqlite3.so
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 76878 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sqlite3_open();

int main() {
sqlite3_open()
; return 0; }



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-25 07:27 UTC] geoffwa at cs dot rmit dot edu dot au
The following patch allows PHP to configure and build successfully:
--- php-old/configure.in        2007-05-31 04:45:59.000000000 +1000
+++ php-new/configure.in        2007-06-25 17:16:31.902000000 +1000
@@ -326,4 +326,6 @@
 PHP_CHECK_FUNC(dn_skipname, resolv, bind)
 
+dnl I wish Solaris came with a /usr/lib/pkgconfig/normal_base_system.pc
+PHP_CHECK_LIBRARY(rt, nanosleep, [PHP_ADD_LIBRARY(rt)], [])
 
 dnl Then headers.

I used PHP_CHECK_LIBRARY in lieu of PHP_CHEC_FUNC as the later picks
up a __nanosleep() symbol from Sun's libc, and ext/standard/basic_functions.c makes use of nanosleep()
 [2007-06-25 16:26 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jun 14 13:01:34 2025 UTC