[PATCH libgpg-error] build: fix mutex size computation on systems without gawk

NIIBE Yutaka gniibe at fsij.org
Tue Jun 23 03:24:06 CEST 2026


Hello,

Alexis Lothoré wrote:
> but when the build host does not have gawk but mawk for example, the
> script fails to parse correctly the objdump output, leading to a faulty
> header being generated:

I see the problem.

> Fix size parsing by replacing objdump, which outputs a hexadecimal value
> (prefixed with 0x) with nm.

Your idea sounds good.


I think that we can go further, to remove use of AWK in the script.

Testing the change, I noticed that use of NM has two possible issue(s).

(1) Considering the future where we use the script for other OS...
When objdump is available, it is highly likely it's GNU objdump
implementation (otherwise, it has compatible options and compatible
output), but it's different in case of NM.  Since NM is a standard tool
(there are multiple active implementations among different OS), we have
to care about portable use of NM.  IIUC, -S option is not portable.  I
think that it is good to use of -P option (which asks the POSIX.2
standard output format), instead.

(2) NM is actually affected by libtool (specifically, m4/libtool.m4).
It is currently no problem for the script, but we should remember.


Attached is revised version.  If no problem, I will push this change.

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-build-No-use-of-awk-with-gen-lock-obj.sh.patch
Type: text/x-diff
Size: 3824 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20260623/fb1e710d/attachment.patch>


More information about the Gnupg-devel mailing list