From 21bf78411ea52c1f67afac7b76a6f56f75b28434 Mon Sep 17 00:00:00 2001 From: Bernard Gautier Date: Thu, 18 Jun 2026 16:49:27 +0200 Subject: [PATCH] package/libgpg-error: make sure to use host-gawk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During its configure step, libgpg-error needs awk: configure -> src/gen-lock-obj.sh -> objdump + awk on test binary This call is used on the output from objdump on a test binary to retrieve the size of some data structure, and generate accordingly an internal header (lock-obj-pub.native.h). However, libgpg-error buildroot package does not depend explicitely on host-gawk: if host-gawk is not part of the build, or if it is built later than libgpg-error, libgpg-error autotool tooling will eventually pick the build machine awk. On top of this issue, despite the configure.ac suggesting that it supports different implementations of awk, libgpg-error configure step will not parse correctly the output from objdump when using mawk, leading to a wrong lock-obj-pub.native.h header being generated: With gawk: typedef struct { long _vers; union { volatile char _priv[24]; long _x_align; long *_xp_align; } u; } gpgrt_lock_t; #define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0,0}}} With mawk: typedef struct { long _vers; union { volatile char _priv[0]; long _x_align; long *_xp_align; } u; } gpgrt_lock_t; #define GPGRT_LOCK_INITIALIZER {1,{{}}} This issue has been observed for example on Debian 13 with mawk installed: it fails to parse mtx_size, leading to a size 0, and so generating crashes at runtime because of the invalid size embedded in libgpg-error. Side note: the lock-obj-pub.native.h header file is correctly generated, when using mawk 1.3.4 20200120 from Debian 12. The described issue happen with mawk 1.3.4 20250131 from Debian 13. libgpg-error should be fixed upstream to properly handle this data structure size guessing even when using mawk, but anyway the corresponding buildroot package should not randomly use the build machine host tooling or buildroot-provided host tooling depending on whether host-gawk has been selected and built before it. Enforce an explicit dependency on host-gawk for libgpg-error to make sure that it systematically uses the buildroot-provided awk. Co-developped-by: Bernard Gautier Signed-off-by: Bernard Gautier Co-developped-by: Alexis Lothoré Signed-off-by: Alexis Lothoré [Julien: add the side note that mawk from debian 12 works] Signed-off-by: Julien Olivain --- package/libgpg-error/libgpg-error.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/libgpg-error/libgpg-error.mk b/package/libgpg-error/libgpg-error.mk index df95e5fe0c..31ffcee743 100644 --- a/package/libgpg-error/libgpg-error.mk +++ b/package/libgpg-error/libgpg-error.mk @@ -12,7 +12,7 @@ LIBGPG_ERROR_LICENSE_FILES = COPYING COPYING.LIB LIBGPG_ERROR_CPE_ID_VENDOR = gnupg LIBGPG_ERROR_INSTALL_STAGING = YES LIBGPG_ERROR_CONFIG_SCRIPTS = gpg-error-config -LIBGPG_ERROR_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) +LIBGPG_ERROR_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-gawk LIBGPG_ERROR_CONF_OPTS = \ cross_compiling=yes \ --host=$(BR2_PACKAGE_LIBGPG_ERROR_SYSCFG) \