After vendoring of sqlite for Rust crates was disabled in commit
6634a9a273e59a9671ce37d8ec84bb67b08b74d6, building a Rust application
that uses Sqlx's sqlite support fails with:

  error: linking with `target-rust-ccld` failed: exit status: 1
    |
    = note: /usr/bin/aarch64-poky-linux/aarch64-poky-linux-ld:
    build/target/aarch64-poky-linux-gnu/release/deps/foo.o:
    in function `sqlx_sqlite::statement::unlock_notify::wait':
      
foo:(.text._RNvNtNtCs5IjsOsRanBC_11sqlx_sqlite9statement13unlock_notify4wait+0x3c):
      undefined reference to `sqlite3_unlock_notify'

This adds a PACKAGECONFIG for enabling the unlock notify API. It enables
it by default for target. The API is small (< 2 kB) and should not be in
the way unless wanted.

Signed-off-by: Peter Kjellerstedt <[email protected]>
---
 meta/recipes-support/sqlite/sqlite3_3.53.4.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-support/sqlite/sqlite3_3.53.4.bb 
b/meta/recipes-support/sqlite/sqlite3_3.53.4.bb
index dcd8acf538..137ec26207 100644
--- a/meta/recipes-support/sqlite/sqlite3_3.53.4.bb
+++ b/meta/recipes-support/sqlite/sqlite3_3.53.4.bb
@@ -31,8 +31,7 @@ CVE_PRODUCT = "sqlite"
 
 inherit pkgconfig siteinfo upstream-stable-release-point
 
-# enable those which are enabled by default in configure
-PACKAGECONFIG ?= "fts4 fts5 rtree dyn_ext"
+PACKAGECONFIG ?= "fts4 fts5 rtree dyn_ext unlock-notify"
 PACKAGECONFIG:class-native ?= "fts4 fts5 rtree dyn_ext"
 
 PACKAGECONFIG[editline] = "--enable-editline 
--with-readline-header=${includedir}/editline/readline.h,--disable-editline,libedit
 ncurses"
@@ -44,6 +43,7 @@ PACKAGECONFIG[rtree] = "--enable-rtree,--disable-rtree"
 PACKAGECONFIG[session] = "--enable-session,--disable-session"
 PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
 PACKAGECONFIG[dyn_ext] = "--enable-load-extension,--disable-load-extension"
+PACKAGECONFIG[unlock-notify] = ""
 
 EXTRA_OECONF = " \
     --enable-shared \
@@ -59,6 +59,9 @@ CFLAGS += "-DUSE_PREAD"
 # Provide column meta-data API
 CFLAGS += "-DSQLITE_ENABLE_COLUMN_METADATA"
 
+# Provide the unlock_notify API
+CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'unlock-notify', 
'-DSQLITE_ENABLE_UNLOCK_NOTIFY', '', d)}"
+
 # Unless SQLITE_BYTEORDER is predefined, the code falls back to build time
 # heuristics, which are not always correct
 CFLAGS += "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 
'-DSQLITE_BYTEORDER=1234', '-DSQLITE_BYTEORDER=4321', d)}"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#246624): 
https://lists.openembedded.org/g/openembedded-core/message/246624
Mute This Topic: https://lists.openembedded.org/mt/121429862/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to