[openwrt/openwrt] gettext-full: force compiling target in C23 standard

LEDE Commits lede-commits at lists.infradead.org
Mon Aug 11 13:28:48 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b6f67ca7394f4e221c27e58c9f8e250179fa142f

commit b6f67ca7394f4e221c27e58c9f8e250179fa142f
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Aug 5 18:52:13 2025 -0400

    gettext-full: force compiling target in C23 standard
    
    Currently, the build system overrides the value of the CC variable
    for actual compilation after configuring for target builds.
    However, the configure script now modifies the CC variable
    to include "-std=gnu23" when the test for C23 features is successful.
    The configure script also tests for the ability to use alignof
    without including the stdalign.h header, and only includes it if necessary.
    The test in the configure script is being done with the C23 standard option
    but the compilation is being done without the C23 standard option,
    leading to an unusual build error where alignof() is not defined.
    
    Resolving the conflict between the autoconf macros and the build system
    causes several other packages to fail, so instead in the meantime,
    force the use of C23 standard to compile as part of the new standard
    includes alignof as a keyword to deprecate the stdalign.h macro.
    
    Forcing use of the new standard is safe for target builds
    as the toolchain is known to support the option
    and is always within our scope of version control.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    Link: https://github.com/openwrt/openwrt/pull/19748
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/libs/gettext-full/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile
index 6441677be7..d277fb10b6 100644
--- a/package/libs/gettext-full/Makefile
+++ b/package/libs/gettext-full/Makefile
@@ -73,6 +73,7 @@ endef
 export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
 
 TARGET_CFLAGS += $(FPIC)
+TARGET_CFLAGS += -std=gnu23
 ifneq ($(HOST_OS),Linux)
   TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
 endif




More information about the lede-commits mailing list