Skip to contentSkip to conversation

sqlite3: upgrade 3.48.0 -> 3.49.1

PATCH In review Peter Marko 3 participants 4 messages May 11, 2025 – Jun 22, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 sqlite3: upgrade 3.48.0 -> 3.49.1

From: Peter Marko <[email protected]>

Handle CVE-2025-3277, CVE-2025-29087 and CVE-2025-29088.

This update includes major change in how it is built. Instead of autotools, autosetup is used.

Autosetup (https://msteveb.github.io/autosetup/) claims to be
* Replacement for autoconf in many situations However it also claims NOT to
* Intended to replace all possible uses of autoconf This means that some autoconf features are not available.

Recipe changes:
* stop inheriting autotools and define B, do_configure and do_install
* depend on zlib unconditionally, autoconf cannot be preconfigured in similar way as autotools
* update packageconfig options to match new syntax
* libedit is detected with ncurses linking options (as seen in do_configure log)
* backport rpaths fix
* define soname to avoid file-rdeps QA error due to wrong library name
* add hack to force cross-compilation in native case to link against zlib in sysroot and thus avoid crashes when sstate-cache from different distro is used
* clean B for do_configure as the new Makefiles do not seem to properly retrigger build if configuration changes

---
v2: use --build=${BUILD_SYS} as an attemt to fix package installation
v3: force cross-compilation in native case by manipulating BUILD_SYS
v4: improve description of BUILD_SYS hack

 meta/recipes-support/sqlite/sqlite3.inc       |  44 ++++++--
 ...tically-fail-the-check-for-rpath-on-.patch | 102 ++++++++++++++++++
 .../{sqlite3_3.48.0.bb => sqlite3_3.49.1.bb}  |   3 +-
 3 files changed, 141 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-support/sqlite/sqlite3/0001-configure-automatically-fail-the-check-for-rpath-on-.patch
 rename meta/recipes-support/sqlite/{sqlite3_3.48.0.bb => sqlite3_3.49.1.bb} (53%)
meta/recipes-support/sqlite/sqlite3.inc +37 -7
index d093ec5859..9e4c2713b7 100644
@@ -14,34 +14,37 @@ def sqlite_download_version(d):
 SQLITE_PV = "${@sqlite_download_version(d)}"
 
 S = "${WORKDIR}/sqlite-autoconf-${SQLITE_PV}"
+B = "${WORKDIR}/build"
 
 UPSTREAM_CHECK_URI = "http://www.sqlite.org/"
 UPSTREAM_CHECK_REGEX = "releaselog/(?P<pver>(\d+[\.\-_]*)+)\.html"
 
 CVE_PRODUCT = "sqlite"
 
-inherit autotools pkgconfig siteinfo
+inherit pkgconfig siteinfo
+
+# zlib is autodetected and gets to sysroots as transitive dependency, make this deterministic
+DEPENDS = "zlib"
 
 # enable those which are enabled by default in configure
 PACKAGECONFIG ?= "fts4 fts5 rtree dyn_ext"
 PACKAGECONFIG:class-native ?= "fts4 fts5 rtree dyn_ext"
 
-PACKAGECONFIG[editline] = "--enable-editline,--disable-editline,libedit"
-PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline ncurses"
+PACKAGECONFIG[editline] = "--enable-editline --with-readline-header=${includedir}/editline/readline.h,--disable-editline,libedit ncurses"
+PACKAGECONFIG[readline] = "--enable-readline --with-readline-header=${includedir}/readline/readline.h,--disable-readline,readline ncurses"
 PACKAGECONFIG[fts3] = "--enable-fts3,--disable-fts3"
 PACKAGECONFIG[fts4] = "--enable-fts4,--disable-fts4"
 PACKAGECONFIG[fts5] = "--enable-fts5,--disable-fts5"
 PACKAGECONFIG[rtree] = "--enable-rtree,--disable-rtree"
 PACKAGECONFIG[session] = "--enable-session,--disable-session"
-PACKAGECONFIG[dyn_ext] = "--enable-dynamic-extensions,--disable-dynamic-extensions"
-PACKAGECONFIG[zlib] = ",,zlib"
-
-CACHED_CONFIGUREVARS += "${@bb.utils.contains('PACKAGECONFIG', 'zlib', '', 'ac_cv_search_deflate=no',d)}"
+PACKAGECONFIG[dyn_ext] = "--enable-load-extension,--disable-load-extension"
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-threadsafe \
     --disable-static-shell \
+    --disable-rpath \
+    --soname=${PV} \
 "
 
 # pread() is in POSIX.1-2001 so any reasonable system must surely support it
@@ -65,4 +68,31 @@ FILES:lib${BPN}-staticdev = "${libdir}/lib*.a"
 
 AUTO_LIBNAME_PKGS = "${MLPREFIX}lib${BPN}"
 
+do_configure() {
+    # native build links against host zlib which is problem when reusing sstate-cache from different host distro
+    # so "destroy" BUILD_SYS to force cross-compilation and thus honor flags/paths provided by the recipe
+    # as cross-compilation is detecded by comparing build and host defines
+    if [ "${BUILD_SYS}" = "${TARGET_SYS}" ]; then
+        BUILD_SYS=${BUILD_ARCH}-native-${BUILD_OS}
+    else
+        BUILD_SYS=${BUILD_SYS}
+    fi
+
+    ${S}/configure \
+        --build=$BUILD_SYS \
+        --host=${TARGET_SYS} \
+        --prefix=${prefix} \
+        --bindir=${bindir} \
+        --libdir=${libdir} \
+        --includedir=${includedir} \
+        --mandir=${mandir} \
+        ${EXTRA_OECONF} \
+        ${PACKAGECONFIG_CONFARGS}
+}
+do_configure[cleandirs] = "${B}"
+
+do_install() {
+    oe_runmake DESTDIR=${D} install
+}
+
 BBCLASSEXTEND = "native nativesdk"
meta/recipes-support/sqlite/sqlite3/0001-configure-automatically-fail-the-check-for-rpath-on-.patch new file +102 -0

102 lines not on this page · raw message

meta/recipes-support/sqlite/sqlite3_3.49.1.bb renamed from meta/recipes-support/sqlite/sqlite3_3.48.0.bb +2 -1
similarity index 53%
rename from meta/recipes-support/sqlite/sqlite3_3.48.0.bb
rename to meta/recipes-support/sqlite/sqlite3_3.49.1.bb
index bd2ac6614d..c3c0670884 100644
@@ -4,5 +4,6 @@ LICENSE = "PD"
 LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=786d3dc581eff03f4fd9e4a77ed00c66"
 
 SRC_URI = "http://www.sqlite.org/2025/sqlite-autoconf-${SQLITE_PV}.tar.gz"
-SRC_URI[sha256sum] = "ac992f7fca3989de7ed1fe99c16363f848794c8c32a158dafd4eb927a2e02fd5"
+SRC_URI[sha256sum] = "106642d8ccb36c5f7323b64e4152e9b719f7c0215acf5bfeac3d5e7f97b59254"
 
+SRC_URI += "file://0001-configure-automatically-fail-the-check-for-rpath-on-.patch"
#1 lore raw
Quoted 28 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Handle CVE-2025-3277, CVE-2025-29087 and CVE-2025-29088.

This update includes major change in how it is built. Instead of autotools, autosetup is used.

Autosetup (https://msteveb.github.io/autosetup/) claims to be
* Replacement for autoconf in many situations However it also claims NOT to
* Intended to replace all possible uses of autoconf This means that some autoconf features are not available.

Recipe changes:
* stop inheriting autotools and define B, do_configure and do_install
* depend on zlib unconditionally, autoconf cannot be preconfigured in similar way as autotools
* update packageconfig options to match new syntax
* libedit is detected with ncurses linking options (as seen in do_configure log)
* backport rpaths fix
* define soname to avoid file-rdeps QA error due to wrong library name
* add hack to force cross-compilation in native case to link against zlib in sysroot and thus avoid crashes when sstate-cache from different distro is used
* clean B for do_configure as the new Makefiles do not seem to properly retrigger build if configuration changes

Quoted 2 lines

---

Hi Peter,

Thanks for the new version. However I believe we still have an error, in oe-selftest and build on ARM hosts:

2025-05-12 08:01:13,149 - oe-selftest - INFO - buildoptions.ArchiverTest.test_arch_work_dir_and_export_source (subunit.RemotedTestCase)
2025-05-12 08:01:13,150 - oe-selftest - INFO -  ... FAIL
...
2025-05-12 08:01:13,150 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/buildoptions.py", line 191, in test_arch_work_dir_and_export_source
    self.assertEqual(res.status, 0, "\nCouldn't build xcursortransparenttheme.\nbitbake output %s" % res.output)
  File "/usr/lib/python3.9/unittest/case.py", line 831, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.9/unittest/case.py", line 824, in _baseAssertEqual
    raise self.failureException(msg)

AssertionError: 1 != 0 :
Couldn't build xcursortransparenttheme.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/1541
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1482
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1482

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 66 lines

-----Original Message-----
From: Mathieu Dubois-Briand <[email protected]>
Sent: Monday, May 12, 2025 14:05
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]
Subject: Re: [OE-core][PATCH v4] sqlite3: upgrade 3.48.0 -> 3.49.1

Quoted 28 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Handle CVE-2025-3277, CVE-2025-29087 and CVE-2025-29088.

This update includes major change in how it is built. Instead of autotools, autosetup is used.

Autosetup (https://msteveb.github.io/autosetup/) claims to be
* Replacement for autoconf in many situations However it also claims NOT to
* Intended to replace all possible uses of autoconf This means that some autoconf features are not available.

Recipe changes:
* stop inheriting autotools and define B, do_configure and do_install
* depend on zlib unconditionally, autoconf cannot be preconfigured in similar way as autotools
* update packageconfig options to match new syntax
* libedit is detected with ncurses linking options (as seen in do_configure log)
* backport rpaths fix
* define soname to avoid file-rdeps QA error due to wrong library name
* add hack to force cross-compilation in native case to link against zlib in sysroot and thus avoid crashes when sstate-cache from different distro is used
* clean B for do_configure as the new Makefiles do not seem to properly retrigger build if configuration changes

Quoted 2 lines

---

Hi Peter,

Thanks for the new version. However I believe we still have an error, in oe-selftest and build on ARM hosts:

2025-05-12 08:01:13,149 - oe-selftest - INFO -
buildoptions.ArchiverTest.test_arch_work_dir_and_export_source
(subunit.RemotedTestCase)
2025-05-12 08:01:13,150 - oe-selftest - INFO -  ... FAIL
...
2025-05-12 08:01:13,150 - oe-selftest - INFO -

testtools.testresult.real._StringException: Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/oe-selftest-
debian/build/meta/lib/oeqa/selftest/cases/buildoptions.py", line 191, in test_arch_work_dir_and_export_source
self.assertEqual(res.status, 0, "\nCouldn't build
xcursortransparenttheme.\nbitbake output %s" % res.output)
File "/usr/lib/python3.9/unittest/case.py", line 831, in assertEqual
assertion_func(first, second, msg=msg)
File "/usr/lib/python3.9/unittest/case.py", line 824, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 1 != 0 :
Couldn't build xcursortransparenttheme.

Quoted 3 lines

https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/1541
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1482
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1482

Just wanted to say I have not missed this, but I currently don't have time to work on this update. If someone else wants to pick it up, please go ahead.
Otherwise, I'll try to find some time in June.

Peter

Quoted 5 lines

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#3 lore raw

I looked a bit into this today. I am using 3.49.2 specifically. On that release I see no way to disable rpaths. FYI: I posted a question in their forum https://sqlite.org/forum/forumpost/13cac3b565

ERROR: sqlite3-5_3.49.2-r0 do_package_qa: QA Issue: libsqlite3: /usr/lib/libsqlite3.so.3.49.2 contains probably-redundant RPATH /usr/lib [useless-rpaths]
ERROR: sqlite3-5_3.49.2-r0 do_package_qa: QA Issue: sqlite3: /usr/bin/sqlite3 contains probably-redundant RPATH /usr/lib [useless-rpaths]

After 3.49.1 the --disable-rpath option was removed which seems strange to me.