php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79056 sqlite does not respect PKG_CONFIG_PATH during compilation
Submitted: 2020-01-02 19:55 UTC Modified: 2020-01-03 22:32 UTC
From: naox at yum dot pl Assigned: cmb (profile)
Status: Closed Package: Compile Failure
PHP Version: 7.4.1 OS:
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: naox at yum dot pl
New email:
PHP Version: OS:

 

 [2020-01-02 19:55 UTC] naox at yum dot pl
Description:
------------
PKG_CONFIG_PATH=/usr/sqlite-autoconf-3300100/lib/pkgconfig ./configure

checking for sqlite3 > 3.7.4... yes
checking for sqlite3_stmt_readonly in -lsqlite3... no
configure: error: Please install SQLite 3.7.4 first or check libsqlite3 is present

I suspect compilation does not respect sqlite from PKG_CONFIG_PATH.
It would be usefull if it printed sqlite version it uses...

When I cut out these test from configure script I got errors like that, which suggest wrong sqlite version was used.

ext/pdo_sqlite/.libs/sqlite_statement.o: In function `pdo_sqlite_stmt_param_hook':
sqlite_statement.c:(.text+0x58f): undefined reference to `sqlite3_reset'
sqlite_statement.c:(.text+0x5e2): undefined reference to `sqlite3_bind_text'
sqlite_statement.c:(.text+0x620): undefined reference to `sqlite3_bind_null'
sqlite_statement.c:(.text+0x697): undefined reference to `sqlite3_bind_blob'
sqlite_statement.c:(.text+0x6d5): undefined reference to `sqlite3_bind_int64'
sqlite_statement.c:(.text+0x71b): undefined reference to `sqlite3_bind_parameter_index'
sqlite_statement.c:(.text+0x738): undefined reference to `sqlite3_bind_null'
sqlite_statement.c:(.text+0x761): undefined reference to `sqlite3_bind_null'
sqlite_statement.c:(.text+0x7f2): undefined reference to `sqlite3_bind_null'
ext/pdo_sqlite/.libs/sqlite_statement.o: In function `pdo_sqlite_stmt_execute':
sqlite_statement.c:(.text+0x88d): undefined reference to `sqlite3_step'
sqlite_statement.c:(.text+0x8e9): undefined reference to `sqlite3_data_count'
sqlite_statement.c:(.text+0x989): undefined reference to `sqlite3_column_count'
sqlite_statement.c:(.text+0xa07): undefined reference to `sqlite3_reset'
sqlite_statement.c:(.text+0xa15): undefined reference to `sqlite3_reset'
sqlite_statement.c:(.text+0xa3e): undefined reference to `sqlite3_changes'
sqlite_statement.c:(.text+0xa4d): undefined reference to `sqlite3_reset'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1




Patches

79056 (last revision 2020-01-03 08:00 UTC by cmb@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-03 08:00 UTC] cmb@php.net
The following patch has been added/updated:

Patch Name: 79056
Revision:   1578038435
URL:        https://bugs.php.net/patch-display.php?bug=79056&patch=79056&revision=1578038435
 [2020-01-03 08:01 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-01-03 08:01 UTC] cmb@php.net
Could you please try with the attached patch?
 [2020-01-03 09:11 UTC] nikic@php.net
@cmb: I don't think this patch makes sense, as the $SQLITE_ prefix is determined by the PKG_CHECK_MODULES() call, which is just SQLITE also in PDO.

I'd suggest something like https://gist.github.com/nikic/75dac4f4bff80945127d1acb84e010a0. The main issue here is that EVAL_LIBLINE should be performed before CHECK_LIBRARY, but in this particular case these CHECK_LIBRARY calls should be omitted entirely, per our policy to trust pkg-config when it comes to package existence.
 [2020-01-03 09:38 UTC] cmb@php.net
Ah, that makes sense!  naox@, please try nikic's patch.
 [2020-01-03 10:09 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1dcdcd79badcd0c685580abb2e4e9064ee8cfa80
Log: Fixed bug #79056
 [2020-01-03 10:09 UTC] nikic@php.net
-Status: Feedback +Status: Closed
 [2020-01-03 10:10 UTC] nikic@php.net
I've landed a slightly larger patch that should also properly handle shared sqlite builds. Please tell me if you still see any issues.
 [2020-01-03 22:32 UTC] naox at yum dot pl
I confirm that patch works.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 21:01:28 2024 UTC