Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v3] zstd: add bench, compress, dict, trace to PACKAGECONFIG
@ 2026-11-30  9:24 Antonin Godard
  2026-11-30  9:34 ` [OE-core] " Marko, Peter
  0 siblings, 1 reply; 3+ messages in thread
From: Antonin Godard @ 2026-11-30  9:24 UTC (permalink / raw)
  To: openembedded-core; +Cc: Thomas Petazzoni, Antonin Godard

Add some PACKAGECONFIG knobs matching zstd's configuration knobs:

- bench toggles the integrated benchmark module (now disabled by default)
- compress toggles zstd compression support (enabled by default)
- dict compiles zstd with support for the integrated dictionary builder
  (now disabled by default)
- trace can display a stack backtrace when execution
  generates a runtime exception (now disabled by default)

The bench and dict options are required for the ptest suite: enable them
for targets when the ptest distro feature is enabled, native build don't
need it.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Changes in v3:
- add back bench + dict for ptests
- Link to v2: https://patch.msgid.link/20261127-zstd-1-6-0-v2-1-37210d2fc042@bootlin.com

Changes in v2:
- Patch 1/2 was merged.
- Adjust PACKAGECONFIG options names and the ones enabled by default.
- My mistake, but some options have to be passed in MOREFLAGS with Zstd,
  so define it at the recipe-level and set it based on PACKAGECONFIG.
- Link to v1: https://patch.msgid.link/20261125-zstd-1-6-0-v1-0-95f50c6b9de6@bootlin.com
---
 meta/recipes-extended/zstd/zstd_1.6.0.bb | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/zstd/zstd_1.6.0.bb b/meta/recipes-extended/zstd/zstd_1.6.0.bb
index 6e4e07050a..4d27e795ba 100644
--- a/meta/recipes-extended/zstd/zstd_1.6.0.bb
+++ b/meta/recipes-extended/zstd/zstd_1.6.0.bb
@@ -22,9 +22,14 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
 
 CVE_PRODUCT = "zstandard"
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "compress"
+PACKAGECONFIG:append:class-target = "${@bb.utils.contains("DISTRO_FEATURES", "ptest", " bench dict", "", d)}"
+PACKAGECONFIG[bench] = ""
+PACKAGECONFIG[compress] = ""
+PACKAGECONFIG[dict] = ""
 PACKAGECONFIG[lz4] = "HAVE_LZ4=1,HAVE_LZ4=0,lz4"
 PACKAGECONFIG[lzma] = "HAVE_LZMA=1,HAVE_LZMA=0,xz"
+PACKAGECONFIG[trace] = ""
 PACKAGECONFIG[zlib] = "HAVE_ZLIB=1,HAVE_ZLIB=0,zlib"
 
 # See programs/README.md for how to use this
@@ -32,8 +37,17 @@ ZSTD_LEGACY_SUPPORT ??= "4"
 
 EXTRA_OEMAKE += "V=1"
 
+# Extra configuration tweaks have to be passed in MOREFLAGS when compiling
+# zstd, which we define using our PACKAGECONFIG definition.
+ZSTD_MOREFLAGS = "\
+    ${@bb.utils.contains("PACKAGECONFIG", "bench", "", "-DZSTD_NOBENCH", d)} \
+    ${@bb.utils.contains("PACKAGECONFIG", "compress", "", "-DZSTD_NOCOMPRESS", d)} \
+    ${@bb.utils.contains("PACKAGECONFIG", "dict", "", "-DZSTD_NODICT", d)} \
+    ${@bb.utils.contains("PACKAGECONFIG", "trace", "", "-DZSTD_NOTRACE", d)} \
+"
+
 do_compile () {
-    oe_runmake ${PACKAGECONFIG_CONFARGS} ZSTD_LEGACY_SUPPORT=${ZSTD_LEGACY_SUPPORT}
+    oe_runmake ${PACKAGECONFIG_CONFARGS} ZSTD_LEGACY_SUPPORT=${ZSTD_LEGACY_SUPPORT} MOREFLAGS="${ZSTD_MOREFLAGS}"
     oe_runmake ${PACKAGECONFIG_CONFARGS} ZSTD_LEGACY_SUPPORT=${ZSTD_LEGACY_SUPPORT} -C contrib/pzstd
 }
 

---
base-commit: 39019629a4ad25557f120ec98305a4a2ad6a8558
change-id: 20261124-zstd-1-6-0-621e66520e4d


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-30 10:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  9:24 [PATCH v3] zstd: add bench, compress, dict, trace to PACKAGECONFIG Antonin Godard
2026-11-30  9:34 ` [OE-core] " Marko, Peter
2026-11-30 10:17   ` Antonin Godard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox