openjpeg: fix run-ptest with busybox sed
PATCH 1/6 openjpeg: fix run-ptest with busybox sed
run-ptest piped ctest output through 'sed -u', which busybox sed does not support, so the pipeline produced no output and the ptest image reported "ptests which had no test results: ['openjpeg']".
Drop sed and classify ctest result lines in awk directly. This also maps Timeout/Exception/Not Run results to FAIL; previously they were printed as e.g. "Exception:: <name>" and ignored by the ptest parser.
--- meta-oe/recipes-graphics/openjpeg/openjpeg/run-ptest | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta-oe/recipes-graphics/openjpeg/openjpeg/run-ptest +8 -1
@@ -1,4 +1,11 @@ #!/bin/sh # Only run unit tests, exclude nonregression and conformance tests that need external data files -ctest -E "(NR-|CONF-|ETS-|testjp2)" -V | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}' +# ctest result lines look like: " 1/29 Test #1: tte0 ..... Passed 0.01 sec" +# anything other than Passed/Skipped/Disabled (Failed, Timeout, Exception, Not Run) is a FAIL +ctest -E "(NR-|CONF-|ETS-|testjp2)" -V | awk '/Test +#[0-9]+:/ { + if ($0 ~ /Passed/) res = "PASS" + else if ($0 ~ /Skipped|Disabled/) res = "SKIP" + else res = "FAIL" + print res ": " $4; fflush() +}'
PATCH 2/6 jsoncpp: fix run-ptest with busybox sed
run-ptest piped ctest output through 'sed -u', which busybox sed does not support, so the pipeline produced no output and the ptest image reported "ptests which had no test results: ['jsoncpp']".
Drop sed and classify ctest result lines in awk directly. This also maps Timeout/Exception/Not Run results to FAIL; previously they were printed as e.g. "Exception:: <name>" and ignored by the ptest parser.
--- meta-oe/recipes-devtools/jsoncpp/files/run-ptest | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta-oe/recipes-devtools/jsoncpp/files/run-ptest +8 -1
@@ -1,4 +1,11 @@ #!/bin/sh cd src -ctest --force-new-ctest-process | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}' +# ctest result lines look like: "1/3 Test #1: jsoncpp_test ..... Passed 0.01 sec" +# anything other than Passed/Skipped/Disabled (Failed, Timeout, Exception, Not Run) is a FAIL +ctest --force-new-ctest-process | awk '/Test +#[0-9]+:/ { + if ($0 ~ /Passed/) res = "PASS" + else if ($0 ~ /Skipped|Disabled/) res = "SKIP" + else res = "FAIL" + print res ": " $4; fflush() +}'
PATCH 3/6 tbb: fix run-ptest with busybox sed
In reply to Khem Rajrun-ptest piped ctest output through 'sed -u', which busybox sed does not support, so the pipeline produced no output and the ptest image reported "ptests which had no test results: ['tbb']".
Drop sed and classify ctest result lines in awk directly. This also maps Timeout/Exception/Not Run results to FAIL; previously they were printed as e.g. "Exception:: <name>" and ignored by the ptest parser.
--- meta-oe/recipes-support/tbb/files/run-ptest | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
meta-oe/recipes-support/tbb/files/run-ptest +8 -1
@@ -1,3 +1,10 @@ #!/bin/sh -ctest | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}' +# ctest result lines look like: " 1/142 Test #1: test_tick_count ..... Passed 0.01 sec" +# anything other than Passed/Skipped/Disabled (Failed, Timeout, Exception, Not Run) is a FAIL +ctest | awk '/Test +#[0-9]+:/ { + if ($0 ~ /Passed/) res = "PASS" + else if ($0 ~ /Skipped|Disabled/) res = "SKIP" + else res = "FAIL" + print res ": " $4; fflush() +}'
PATCH 4/6 mariadb: fix AES CBC/CTR/GCM with OpenSSL 4.0
In reply to Khem RajThe aes and mf_iocache unit tests (mariadb-ptest) fail with OpenSSL 4.0 for every AES mode that uses an IV, while ECB keeps working.
MyCTX in mysys_ssl/my_crypt.cc keeps the EVP_CIPHER_CTX in a stack buffer and initializes it with memset() + EVP_CIPHER_CTX_reset(). OpenSSL 3.x reset() ended in its legacy path with ctx->iv_len = -1, but OpenSSL 4.0 removed that path and returns early when no cipher is set, leaving iv_len at 0. EVP_CipherInit_ex() then hands IV length 0 to the provider, which fails with "ossl_cipher_generic_initiv: invalid iv length", so AES_ENCRYPT(), encrypted temporary files etc. break.
Backport the proposed upstream fix, which allocates the context with EVP_CIPHER_CTX_new()/EVP_CIPHER_CTX_free() and drops the stack buffer hack together with check_openssl_compatibility().
Upstream: https://jira.mariadb.org/browse/MDEV-40287
https://github.com/MariaDB/server/pull/5652
--- meta-oe/recipes-dbs/mysql/mariadb.inc | 1 + ...NCRYPT-and-KDF-return-NULL-with-Open.patch | 290 ++++++++++++++++++ 2 files changed, 291 insertions(+) create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/0001-MDEV-40287-AES_ENCRYPT-and-KDF-return-NULL-with-Open.patch
meta-oe/recipes-dbs/mysql/mariadb.inc +1 -0
@@ -26,6 +26,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ file://0001-support-reproducible-builds.patch \ file://0001-storage-mroonga-CMakeLists.txt-fix-reproducible-buil.patch \ file://c21bb11be28ae9b2432b2a661bf38a197cf9514d.patch \ + file://0001-MDEV-40287-AES_ENCRYPT-and-KDF-return-NULL-with-Open.patch \ " SRC_URI[sha256sum] = "5ab7883db519bfcebfdd2aac09bc5544a12ce328f39edd46d0bf01690615ef6c"
meta-oe/recipes-dbs/mysql/mariadb/0001-MDEV-40287-AES_ENCRYPT-and-KDF-return-NULL-with-Open.patch new file +290 -0
290 lines not on this page · raw message
PATCH 5/6 redis: Do not build the test modules during cross compile
In reply to Khem Rajsrc/Makefile's all target carries a module_tests prerequisite, which recurses into tests/modules. That Makefile pins the compiler to whatever gcc is in PATH:
# This is a hack to override the default CC. When running with SANITIZER=memory
# tough we want to keep the compiler as clang as MSan is not supported for gcc
ifeq ($(uname_S),Linux)
ifneq ($(SANITIZER),memory)
LD = gcc
CC = gcc
endif
endifwhile still taking CFLAGS/LDFLAGS from the environment, so a cross build compiles and links all 47 test modules with the build host's gcc using the target compiler flags. With the gcc toolchain those flags include -fcanon-prefix-map (DEBUG_PREFIX_MAP_EXTRA in meta/classes/toolchain/gcc.bbclass), which only exists in GCC >= 13. The cross compiler always has it, the build host's gcc may not, and the build then fails:
| gcc -I../../src -O2 -g -fcanon-prefix-map \
-ffile-prefix-map=.../sources/redis-8.10.1=/usr/src/debug/redis/8.10.1 \
... -std=gnu11 -O2 -fPIC -c commandfilter.c -o commandfilter.xo
| gcc: error: unrecognized command-line option '-fcanon-prefix-map';
did you mean '-fmacro-prefix-map='?The modules are test-only artifacts: nothing links or installs them, and only the tcl suite that make test drives from the build tree consumes them. Drop them from all so no host compiler takes part in the cross build at all; test keeps its own module_tests prerequisite. This has to happen in the Makefile rather than by naming narrower goals in do_compile, because install: all re-runs the phony target on its own.
With the patch applied the only compiler left in log.do_compile is ${TARGET_PREFIX}gcc, where 47 host gcc compile and 47 host gcc link invocations used to be.
--- ...-not-build-the-test-modules-from-all.patch | 58 +++++++++++++++++++ .../recipes-extended/redis/redis_8.10.1.bb | 1 + 2 files changed, 59 insertions(+) create mode 100644 meta-oe/recipes-extended/redis/redis-8.10.1/0006-src-Makefile-do-not-build-the-test-modules-from-all.patch
meta-oe/recipes-extended/redis/redis-8.10.1/0006-src-Makefile-do-not-build-the-test-modules-from-all.patch new file +58 -0
@@ -0,0 +1,58 @@ +From: Khem Raj <[email protected]> +Date: Fri, 12 Sep 2026 09:10:00 -0700 +Subject: [PATCH] src/Makefile: do not build the test modules from `all` + +`all` carries a module_tests prerequisite, which recurses into +../tests/modules. That Makefile deliberately pins the compiler to the +one found in PATH: + + # This is a hack to override the default CC. When running with SANITIZER=memory + # tough we want to keep the compiler as clang as MSan is not supported for gcc + ifeq ($(uname_S),Linux) + ifneq ($(SANITIZER),memory) + LD = gcc + CC = gcc + endif + endif + +but it keeps taking CFLAGS/LDFLAGS from the environment. In a cross +build that combination compiles and links the 47 test modules with the +*build host* gcc while handing it the *target* compiler flags: + + gcc -I../../src -O2 -g -fcanon-prefix-map \ + -ffile-prefix-map=.../sources/redis-8.10.1=/usr/src/debug/redis/8.10.1 \ + ... -fPIC -c commandfilter.c -o commandfilter.xo + gcc: error: unrecognized command-line option '-fcanon-prefix-map'; + did you mean '-fmacro-prefix-map='? + +-fcanon-prefix-map only exists in GCC >= 13, and the target toolchain's +support for it says nothing about the build host's, so the build breaks +on any host with an older gcc. + +The modules are test-only artifacts: nothing links or installs them, +and they are consumed solely by the tcl suite that `make test` drives +from the build tree. Drop them from `all` (`test` keeps its own +module_tests prerequisite) so no host compiler is involved in the +cross build at all. This has to happen in the Makefile rather than by +picking narrower goals in the caller, because `install: all` re-runs +the phony module_tests target on its own. + +Upstream-Status: Inappropriate [oe-specific] +Signed-off-by: Khem Raj <[email protected]> +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 5cb4f67..4fb643b 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -410,7 +410,7 @@ REDIS_CHECK_RDB_NAME=redis-check-rdb$(PROG_SUFFIX) + REDIS_CHECK_AOF_NAME=redis-check-aof$(PROG_SUFFIX) + ALL_SOURCES=$(sort $(patsubst %.o,%.c,$(REDIS_SERVER_OBJ) $(REDIS_VEC_SETS_OBJ) $(REDIS_CLI_OBJ) $(REDIS_BENCHMARK_OBJ))) + +-all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME) $(TLS_MODULE) module_tests ++all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME) $(TLS_MODULE) + @echo "" + @echo "Hint: It's a good idea to run 'make test' ;)" + @echo ""
meta-oe/recipes-extended/redis/redis_8.10.1.bb +1 -0
@@ -15,6 +15,7 @@ SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \ file://0003-hack-to-force-use-of-libc-malloc.patch \ file://0004-src-Do-not-reset-FINAL_LIBS.patch \ file://0005-Define-_GNU_SOURCE-to-get-PTHREAD_MUTEX_INITIALIZER.patch \ + file://0006-src-Makefile-do-not-build-the-test-modules-from-all.patch \ " SRC_URI[sha256sum] = "60166c95ab7aedaa9dfe516de685be0a4dd87be95ded59ba429df14c13f1b663"
PATCH 6/6 bpftrace: Keep -fcanon-prefix-map away from the build host gcc
In reply to Khem Rajcmake/BuildBPF.cmake compiles the BPF data source with the plain gcc it finds in PATH (find_program(GCC gcc)) rather than with the cross compiler, because the BTF encoding step needs gcc plus pahole. The recipe exports DEBUG_PREFIX_MAP and 0001-cmake-BuildBPF.cmake-introduce-DEBUG_PREFIX_MAP.patch hands it to that command so the embedded objects do not carry build paths.
DEBUG_PREFIX_MAP also picks up DEBUG_PREFIX_MAP_EXTRA, which is -fcanon-prefix-map for the gcc toolchain (meta/classes/toolchain/gcc.bbclass). That option only exists in GCC >= 13: the cross compiler always has it, the build host's gcc may not, and the ptest enabled build then fails with
gcc: error: unrecognized command-line option '-fcanon-prefix-map';
did you mean '-fmacro-prefix-map='?
Drop it, the way frr and kernel-selftest already do for the same reason. The four -ffile-prefix-map= rewrites are all this needs: with the extra removed tests/data/data_source.o still contains no build paths, only /usr/src/debug/bpftrace/0.26.1.
--- .../recipes-devtools/bpftrace/bpftrace_0.26.1.bb | 11 +++++++++++ 1 file changed, 11 insertions(+)
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.26.1.bb +11 -0
@@ -28,6 +28,17 @@ inherit bash-completion cmake ptest pkgconfig export DEBUG_PREFIX_MAP +# cmake/BuildBPF.cmake compiles the BPF data source with the plain gcc it finds +# in PATH, i.e. the build host's compiler (see its own commentary for why it has +# to be gcc), and 0001-cmake-BuildBPF.cmake-introduce-DEBUG_PREFIX_MAP.patch +# hands it DEBUG_PREFIX_MAP so the embedded objects do not leak build paths. +# -fcanon-prefix-map, which DEBUG_PREFIX_MAP_EXTRA adds for the gcc toolchain, +# only exists in GCC >= 13: the target compiler always has it, the build host's +# gcc may not, and then the build dies with +# gcc: error: unrecognized command-line option '-fcanon-prefix-map' +# The -ffile-prefix-map= rewrites are all this needs, so drop the extra. +DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" + PACKAGECONFIG ?= " \ ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)} \