diff options
| author | Peter Marko <peter.marko@siemens.com> | 2025-10-13 09:08:46 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:35 +0000 |
| commit | d2b3a8575914f3f8254effd5b7cdd9498e90ed12 (patch) | |
| tree | bf14db55dd6523decaf18e33d6d9a73c694481db | |
| parent | cb9a8570c96b0a3785151a287713a7a667ce3f5c (diff) | |
| download | poky-d2b3a8575914f3f8254effd5b7cdd9498e90ed12.tar.gz | |
sqlite3: upgrade 3.48.0 -> 3.50.4
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
* add patch to disable zlib as autosetup cannot be preconfigured like
autotools to force function calls
* 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
* clean B for do_configure as the new Makefiles do not seem to properly
retrigger build if configuration changes
(From OE-Core rev: 8d3a6af29be7baeeb85f1bf2477fecf89c6f0e7e)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 files changed, 151 insertions, 15 deletions
diff --git a/meta/recipes-support/sqlite/sqlite3.inc b/meta/recipes-support/sqlite/sqlite3.inc index 28a33282ae..94dbc38ec5 100644 --- a/meta/recipes-support/sqlite/sqlite3.inc +++ b/meta/recipes-support/sqlite/sqlite3.inc | |||
| @@ -14,34 +14,35 @@ def sqlite_download_version(d): | |||
| 14 | SQLITE_PV = "${@sqlite_download_version(d)}" | 14 | SQLITE_PV = "${@sqlite_download_version(d)}" |
| 15 | 15 | ||
| 16 | S = "${UNPACKDIR}/sqlite-autoconf-${SQLITE_PV}" | 16 | S = "${UNPACKDIR}/sqlite-autoconf-${SQLITE_PV}" |
| 17 | B = "${WORKDIR}/build" | ||
| 17 | 18 | ||
| 18 | UPSTREAM_CHECK_URI = "http://www.sqlite.org/" | 19 | UPSTREAM_CHECK_URI = "http://www.sqlite.org/" |
| 19 | UPSTREAM_CHECK_REGEX = "releaselog/(?P<pver>(\d+[\.\-_]*)+)\.html" | 20 | UPSTREAM_CHECK_REGEX = "releaselog/(?P<pver>(\d+[\.\-_]*)+)\.html" |
| 20 | 21 | ||
| 21 | CVE_PRODUCT = "sqlite" | 22 | CVE_PRODUCT = "sqlite" |
| 22 | 23 | ||
| 23 | inherit autotools pkgconfig siteinfo | 24 | inherit pkgconfig siteinfo |
| 24 | 25 | ||
| 25 | # enable those which are enabled by default in configure | 26 | # enable those which are enabled by default in configure |
| 26 | PACKAGECONFIG ?= "fts4 fts5 rtree dyn_ext" | 27 | PACKAGECONFIG ?= "fts4 fts5 rtree dyn_ext" |
| 27 | PACKAGECONFIG:class-native ?= "fts4 fts5 rtree dyn_ext" | 28 | PACKAGECONFIG:class-native ?= "fts4 fts5 rtree dyn_ext" |
| 28 | 29 | ||
| 29 | PACKAGECONFIG[editline] = "--enable-editline,--disable-editline,libedit" | 30 | PACKAGECONFIG[editline] = "--enable-editline --with-readline-header=${includedir}/editline/readline.h,--disable-editline,libedit ncurses" |
| 30 | PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline ncurses" | 31 | PACKAGECONFIG[readline] = "--enable-readline --with-readline-header=${includedir}/readline/readline.h,--disable-readline,readline ncurses" |
| 31 | PACKAGECONFIG[fts3] = "--enable-fts3,--disable-fts3" | 32 | PACKAGECONFIG[fts3] = "--enable-fts3,--disable-fts3" |
| 32 | PACKAGECONFIG[fts4] = "--enable-fts4,--disable-fts4" | 33 | PACKAGECONFIG[fts4] = "--enable-fts4,--disable-fts4" |
| 33 | PACKAGECONFIG[fts5] = "--enable-fts5,--disable-fts5" | 34 | PACKAGECONFIG[fts5] = "--enable-fts5,--disable-fts5" |
| 34 | PACKAGECONFIG[rtree] = "--enable-rtree,--disable-rtree" | 35 | PACKAGECONFIG[rtree] = "--enable-rtree,--disable-rtree" |
| 35 | PACKAGECONFIG[session] = "--enable-session,--disable-session" | 36 | PACKAGECONFIG[session] = "--enable-session,--disable-session" |
| 36 | PACKAGECONFIG[dyn_ext] = "--enable-dynamic-extensions,--disable-dynamic-extensions" | 37 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" |
| 37 | PACKAGECONFIG[zlib] = ",,zlib" | 38 | PACKAGECONFIG[dyn_ext] = "--enable-load-extension,--disable-load-extension" |
| 38 | |||
| 39 | CACHED_CONFIGUREVARS += "${@bb.utils.contains('PACKAGECONFIG', 'zlib', '', 'ac_cv_search_deflate=no',d)}" | ||
| 40 | 39 | ||
| 41 | EXTRA_OECONF = " \ | 40 | EXTRA_OECONF = " \ |
| 42 | --enable-shared \ | 41 | --enable-shared \ |
| 43 | --enable-threadsafe \ | 42 | --enable-threadsafe \ |
| 44 | --disable-static-shell \ | 43 | --disable-static-shell \ |
| 44 | --disable-rpath \ | ||
| 45 | --soname=legacy \ | ||
| 45 | " | 46 | " |
| 46 | 47 | ||
| 47 | # pread() is in POSIX.1-2001 so any reasonable system must surely support it | 48 | # pread() is in POSIX.1-2001 so any reasonable system must surely support it |
| @@ -65,4 +66,22 @@ FILES:lib${BPN}-staticdev = "${libdir}/lib*.a" | |||
| 65 | 66 | ||
| 66 | AUTO_LIBNAME_PKGS = "${MLPREFIX}lib${BPN}" | 67 | AUTO_LIBNAME_PKGS = "${MLPREFIX}lib${BPN}" |
| 67 | 68 | ||
| 69 | do_configure() { | ||
| 70 | ${S}/configure \ | ||
| 71 | --build=${BUILD_SYS} \ | ||
| 72 | --host=${TARGET_SYS} \ | ||
| 73 | --prefix=${prefix} \ | ||
| 74 | --bindir=${bindir} \ | ||
| 75 | --libdir=${libdir} \ | ||
| 76 | --includedir=${includedir} \ | ||
| 77 | --mandir=${mandir} \ | ||
| 78 | ${EXTRA_OECONF} \ | ||
| 79 | ${PACKAGECONFIG_CONFARGS} | ||
| 80 | } | ||
| 81 | do_configure[cleandirs] = "${B}" | ||
| 82 | |||
| 83 | do_install() { | ||
| 84 | oe_runmake DESTDIR=${D} install | ||
| 85 | } | ||
| 86 | |||
| 68 | BBCLASSEXTEND = "native nativesdk" | 87 | BBCLASSEXTEND = "native nativesdk" |
diff --git a/meta/recipes-support/sqlite/sqlite3/0001-Add-the-disable-rpath-configure-script-flag-to-addre.patch b/meta/recipes-support/sqlite/sqlite3/0001-Add-the-disable-rpath-configure-script-flag-to-addre.patch new file mode 100644 index 0000000000..f1e93a1c9a --- /dev/null +++ b/meta/recipes-support/sqlite/sqlite3/0001-Add-the-disable-rpath-configure-script-flag-to-addre.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | From 87c807c6dd4df67328919fa28e89a06839e634fe Mon Sep 17 00:00:00 2001 | ||
| 2 | From: stephan <stephan@noemail.net> | ||
| 3 | Date: Sun, 22 Jun 2025 22:48:11 +0000 | ||
| 4 | Subject: [PATCH] Add the --disable-rpath configure script flag to address | ||
| 5 | [forum:13cac3b56516f849 | forum post 13cac3b56516f849]. | ||
| 6 | |||
| 7 | FossilOrigin-Name: a59d9bb25e518f5d79f654615b92f6c50cfb704b5abee0f820912644b89366c5 | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/87c807c6dd4df67328919fa28e89a06839e634fe] | ||
| 10 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 11 | --- | ||
| 12 | autosetup/sqlite-config.tcl | 18 +++++++++--------- | ||
| 13 | 1 file changed, 9 insertions(+), 9 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl | ||
| 16 | index bb81123204..4dd065095e 100644 | ||
| 17 | --- a/autosetup/sqlite-config.tcl | ||
| 18 | +++ b/autosetup/sqlite-config.tcl | ||
| 19 | @@ -334,8 +334,8 @@ proc sqlite-configure {buildMode configScript} { | ||
| 20 | => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c} | ||
| 21 | } | ||
| 22 | {canonical autoconf} { | ||
| 23 | - # A potential TODO without a current use case: | ||
| 24 | - #rpath=1 => {Disable use of the rpath linker flag} | ||
| 25 | + rpath=1 => {Disable use of the rpath linker flag} | ||
| 26 | + | ||
| 27 | # soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded | ||
| 28 | soname:=legacy | ||
| 29 | => {SONAME for libsqlite3.so. "none", or not using this flag, sets no | ||
| 30 | @@ -2119,7 +2119,6 @@ proc sqlite-handle-tcl {} { | ||
| 31 | ######################################################################## | ||
| 32 | # Handle the --enable/disable-rpath flag. | ||
| 33 | proc sqlite-handle-rpath {} { | ||
| 34 | - proj-check-rpath | ||
| 35 | # autosetup/cc-shared.tcl sets the rpath flag definition in | ||
| 36 | # [get-define SH_LINKRPATH], but it does so on a per-platform basis | ||
| 37 | # rather than as a compiler check. Though we should do a proper | ||
| 38 | @@ -2128,12 +2127,13 @@ proc sqlite-handle-rpath {} { | ||
| 39 | # for which sqlite-env-is-unix-on-windows returns a non-empty | ||
| 40 | # string. | ||
| 41 | |||
| 42 | -# if {[proj-opt-truthy rpath]} { | ||
| 43 | -# proj-check-rpath | ||
| 44 | -# } else { | ||
| 45 | -# msg-result "Disabling use of rpath." | ||
| 46 | -# define LDFLAGS_RPATH "" | ||
| 47 | -# } | ||
| 48 | + # https://sqlite.org/forum/forumpost/13cac3b56516f849 | ||
| 49 | + if {[proj-opt-truthy rpath]} { | ||
| 50 | + proj-check-rpath | ||
| 51 | + } else { | ||
| 52 | + msg-result "Disabling use of rpath." | ||
| 53 | + define LDFLAGS_RPATH "" | ||
| 54 | + } | ||
| 55 | } | ||
| 56 | |||
| 57 | ######################################################################## | ||
diff --git a/meta/recipes-support/sqlite/sqlite3/0002-Add-option-to-disable-zlib.patch b/meta/recipes-support/sqlite/sqlite3/0002-Add-option-to-disable-zlib.patch new file mode 100644 index 0000000000..2855372c21 --- /dev/null +++ b/meta/recipes-support/sqlite/sqlite3/0002-Add-option-to-disable-zlib.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | From f98a739032dd863ba8dd315729ded7ad0c86473c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Marko <peter.marko@siemens.com> | ||
| 3 | Date: Sun, 12 Oct 2025 23:32:46 +0200 | ||
| 4 | Subject: [PATCH] Add option to disable zlib | ||
| 5 | |||
| 6 | Autotools allowed to disable zlib by preconfiguring variable | ||
| 7 | 'ac_cv_search_deflate=no'. | ||
| 8 | Autosetup does not seem to offer this option, so implement real option. | ||
| 9 | |||
| 10 | Note that configuring sqlite without zlib is virtually impossible zlib | ||
| 11 | normally gets into the system with toolchain. So the only option is to | ||
| 12 | configure it out. | ||
| 13 | |||
| 14 | This change is being done for Yocto project, where it's currently | ||
| 15 | important to avoid additional dependencies having to restore chain of | ||
| 16 | dependencies in "restore build from cache" scenario. | ||
| 17 | |||
| 18 | Note about upstream status: | ||
| 19 | Submitting patches to sqlite is problematic because of their policy of | ||
| 20 | public domain declaration. | ||
| 21 | This patch or a at least request to make zlib dependency optional | ||
| 22 | should be submitted to their forum, however I was not able to register | ||
| 23 | there. | ||
| 24 | |||
| 25 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 26 | Upstream-Status: Inappropriate [oe-specific] | ||
| 27 | --- | ||
| 28 | autosetup/sqlite-config.tcl | 10 +++++++++- | ||
| 29 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
| 30 | |||
| 31 | diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl | ||
| 32 | index 85fe414382..77190a7053 100644 | ||
| 33 | --- a/autosetup/sqlite-config.tcl | ||
| 34 | +++ b/autosetup/sqlite-config.tcl | ||
| 35 | @@ -274,6 +274,14 @@ proc sqlite-configure {buildMode configScript} { | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | + # Other options for CLI shell | ||
| 40 | + cli-shell { | ||
| 41 | + {*} { | ||
| 42 | + zlib=1 | ||
| 43 | + => {Disable zlib support} | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | # Options for ICU: International Components for Unicode | ||
| 48 | icu { | ||
| 49 | {*} { | ||
| 50 | @@ -641,7 +649,7 @@ proc sqlite-check-common-system-deps {} { | ||
| 51 | string.h strings.h \ | ||
| 52 | inttypes.h | ||
| 53 | |||
| 54 | - if {[cc-check-includes zlib.h] && [proj-check-function-in-lib deflate z]} { | ||
| 55 | + if {[opt-bool zlib] && [cc-check-includes zlib.h] && [proj-check-function-in-lib deflate z]} { | ||
| 56 | # TODO? port over the more sophisticated zlib search from the fossil auto.def | ||
| 57 | define HAVE_ZLIB 1 | ||
| 58 | define LDFLAGS_ZLIB -lz | ||
diff --git a/meta/recipes-support/sqlite/sqlite3_3.48.0.bb b/meta/recipes-support/sqlite/sqlite3_3.48.0.bb deleted file mode 100644 index bd2ac6614d..0000000000 --- a/meta/recipes-support/sqlite/sqlite3_3.48.0.bb +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | require sqlite3.inc | ||
| 2 | |||
| 3 | LICENSE = "PD" | ||
| 4 | LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=786d3dc581eff03f4fd9e4a77ed00c66" | ||
| 5 | |||
| 6 | SRC_URI = "http://www.sqlite.org/2025/sqlite-autoconf-${SQLITE_PV}.tar.gz" | ||
| 7 | SRC_URI[sha256sum] = "ac992f7fca3989de7ed1fe99c16363f848794c8c32a158dafd4eb927a2e02fd5" | ||
| 8 | |||
diff --git a/meta/recipes-support/sqlite/sqlite3_3.50.4.bb b/meta/recipes-support/sqlite/sqlite3_3.50.4.bb new file mode 100644 index 0000000000..b822d7e919 --- /dev/null +++ b/meta/recipes-support/sqlite/sqlite3_3.50.4.bb | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | require sqlite3.inc | ||
| 2 | |||
| 3 | LICENSE = "PD" | ||
| 4 | LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=786d3dc581eff03f4fd9e4a77ed00c66" | ||
| 5 | |||
| 6 | SRC_URI = "http://www.sqlite.org/2025/sqlite-autoconf-${SQLITE_PV}.tar.gz" | ||
| 7 | SRC_URI[sha256sum] = "a3db587a1b92ee5ddac2f66b3edb41b26f9c867275782d46c3a088977d6a5b18" | ||
| 8 | |||
| 9 | SRC_URI += "file://0001-Add-the-disable-rpath-configure-script-flag-to-addre.patch" | ||
| 10 | SRC_URI += "file://0002-Add-option-to-disable-zlib.patch" | ||
