Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] zstd: add bench, compress, dict, trace to PACKAGECONFIG
@ 2026-11-27 10:25 Antonin Godard
  2026-11-28  7:59 ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 2+ messages in thread
From: Antonin Godard @ 2026-11-27 10:25 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)

Signed-off-by: Antonin Godard <antonin.godard@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 | 17 +++++++++++++++--
 1 file changed, 15 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..925c3592a9 100644
--- a/meta/recipes-extended/zstd/zstd_1.6.0.bb
+++ b/meta/recipes-extended/zstd/zstd_1.6.0.bb
@@ -22,9 +22,13 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
 
 CVE_PRODUCT = "zstandard"
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "compress"
+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 +36,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] 2+ messages in thread

* Re: [OE-core] [PATCH v2] zstd: add bench, compress, dict, trace to PACKAGECONFIG
  2026-11-27 10:25 [PATCH v2] zstd: add bench, compress, dict, trace to PACKAGECONFIG Antonin Godard
@ 2026-11-28  7:59 ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Dubois-Briand @ 2026-11-28  7:59 UTC (permalink / raw)
  To: antonin.godard, openembedded-core; +Cc: Thomas Petazzoni

On Fri Nov 27, 2026 at 11:25 AM CET, Antonin Godard via openembedded-core wrote:
> 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)
>
> Signed-off-by: Antonin Godard <antonin.godard@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
> ---

Hi Antonin,

Thanks for the new version.

It looks like disabling features breaks the associated ptests:

Failed ptests:
{'zstd': ['dict-builder/empty-input.sh',
          'dict-builder/empty-input.sh.check_exit',
          'dict-builder/empty-input.sh.check_stderr',
          'dict-builder/no-inputs.sh',
          'dict-builder/no-inputs.sh.check_exit',
          'dict-builder/no-inputs.sh.check_stderr',
          'dict-builder/sample-count-overflow.sh',
          'dict-builder/sample-count-overflow.sh.check_exit',
          'basic/bench-decompress-multiple.sh',
          'basic/bench-decompress-multiple.sh.check_exit',
          'cli-tests']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/110/builds/1659
https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/5024

Can you have a look at the issue?

Thanks,
Mathieu

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


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

end of thread, other threads:[~2026-11-28  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 10:25 [PATCH v2] zstd: add bench, compress, dict, trace to PACKAGECONFIG Antonin Godard
2026-11-28  7:59 ` [OE-core] " Mathieu Dubois-Briand

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