Skip to contentSkip to conversation

m4: Backport a patch to build with --disable-nls

PATCH In review Peter Kjellerstedt 3 participants 3 messages Jun 2, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m4: Backport a patch to build with --disable-nls

Building with USE_NLS = "no" results in the following errors:

lib/spawn-pipe.c: In function 'create_pipe':
lib/spawn-pipe.c:218:7: error: format not a string literal and no format arguments [-Werror=format-security]

    218 |       error (EXIT_FAILURE, errno, _("cannot create pipe"));
        |       ^~~~~
  lib/spawn-pipe.c:221:7: error: format not a string literal and no
  format arguments [-Werror=format-security]
    221 |       error (EXIT_FAILURE, errno, _("cannot create pipe"));
        |       ^~~~~
  lib/clean-temp.c: In function 'create_temp_dir':
  lib/clean-temp.c:234:7: error: format not a string literal and no
  format arguments [-Werror=format-security]
    234 |       error (0, errno,
        |       ^~~~~

Backport a patch from gnulib to avoid the problem.

---
 meta/recipes-devtools/m4/m4-1.4.20.inc        |   1 +
 ...gcc-Wformat-security-warnings-with-d.patch | 133 ++++++++++++++++++
 2 files changed, 134 insertions(+)
 create mode 100644 meta/recipes-devtools/m4/m4/0001-gettext-h-Avoid-gcc-Wformat-security-warnings-with-d.patch
meta/recipes-devtools/m4/m4-1.4.20.inc +1 -0
index 2ea3a9bace..0640395050 100644
@@ -7,6 +7,7 @@ GNU M4 also has built-in functions for including files, running shell commands,
 inherit autotools texinfo ptest gettext
 
 SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz \
+           file://0001-gettext-h-Avoid-gcc-Wformat-security-warnings-with-d.patch \
            "
 SRC_URI:append:class-target = " file://run-ptest \
                                 file://serial-tests-config.patch \
meta/recipes-devtools/m4/m4/0001-gettext-h-Avoid-gcc-Wformat-security-warnings-with-d.patch new file +133 -0

133 lines not on this page · raw message

#1 lore raw
Quoted 17 lines · Peter Kjellerstedt via lists.openembedded.org

Building with USE_NLS = "no" results in the following errors:

  lib/spawn-pipe.c: In function 'create_pipe':
  lib/spawn-pipe.c:218:7: error: format not a string literal and no format arguments [-Werror=format-security]
    218 |       error (EXIT_FAILURE, errno, _("cannot create pipe")); |       ^~~~~
  lib/spawn-pipe.c:221:7: error: format not a string literal and no format arguments [-Werror=format-security]
    221 |       error (EXIT_FAILURE, errno, _("cannot create pipe")); |       ^~~~~
  lib/clean-temp.c: In function 'create_temp_dir':
  lib/clean-temp.c:234:7: error: format not a string literal and no format arguments [-Werror=format-security]
    234 |       error (0, errno,
        |       ^~~~~

Quoted 3 lines

Backport a patch from gnulib to avoid the problem.

I thought we disabled nls for native recipes so I'm wondering why we don't see this failure with m4-native? Perhaps we don't have - Werror=format-security in that case?

Cheers,

Richard

#2 lore raw
Quoted 28 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: den 2 juni 2025 23:13
To: Peter Kjellerstedt <[email protected]>; [email protected]
Subject: Re: [OE-core] [PATCH] m4: Backport a patch to build with --disable-nls

Quoted 17 lines · Peter Kjellerstedt via lists.openembedded.org

Building with USE_NLS = "no" results in the following errors:

  lib/spawn-pipe.c: In function 'create_pipe':
  lib/spawn-pipe.c:218:7: error: format not a string literal and no format arguments [-Werror=format-security]
    218 |       error (EXIT_FAILURE, errno, _("cannot create pipe")); |       ^~~~~
  lib/spawn-pipe.c:221:7: error: format not a string literal and no format arguments [-Werror=format-security]
    221 |       error (EXIT_FAILURE, errno, _("cannot create pipe")); |       ^~~~~
  lib/clean-temp.c: In function 'create_temp_dir':
  lib/clean-temp.c:234:7: error: format not a string literal and no format arguments [-Werror=format-security]
    234 |       error (0, errno,
        |       ^~~~~

Quoted 3 lines

Backport a patch from gnulib to avoid the problem.

Quoted 7 lines

I thought we disabled nls for native recipes so I'm wondering why we don't see this failure with m4-native? Perhaps we don't have - Werror=format-security in that case?

Cheers,

Richard

Correct on both accounts. --disable-nls is enabled when building natively, but -Werror=format-security is not.

//Peter