[openwrt/openwrt] ncurses: Add -std=gnu17 to CFLAGS to avoid a GCC15 error when building with glibc

LEDE Commits lede-commits at lists.infradead.org
Wed Jul 9 01:38:30 PDT 2025


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

commit 3d776d31a4fc53c3e62cccc09e6352ab3d9da092
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Tue Jul 8 15:43:12 2025 -0400

    ncurses: Add -std=gnu17 to CFLAGS to avoid a GCC15 error when building with glibc
    
    Without the newly introduced flag, building with libc ends in errors such the below.
    There is an upstream fix[1], but backporting it is not straight forward.
    
    /scratch/union/staging_dir/toolchain-x86_64_gcc-15.1.0_glibc/x86_64-openwrt-linux-gnu/include/c++/15.1.0/cstddef:81:21: error: redefinition of 'struct std::__byte_operand<unsigned char>'
       81 |   template<> struct __byte_operand<unsigned char> { using __type = byte; };
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /scratch/union/staging_dir/toolchain-x86_64_gcc-15.1.0_glibc/x86_64-openwrt-linux-gnu/include/c++/15.1.0/cstddef:78:21: note: previous definition of 'struct std::__byte_operand<unsigned char>'
       78 |   template<> struct __byte_operand<bool> { using __type = byte; };
          |                     ^~~~~~~~~~~~~~~~~~~~
    make[4]: *** [Makefile:438: ../obj_s/cursesp.o] Error 1
    
    1. https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commit;h=394a1a6cf317912584592e33184ef550e738a4b9
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/19335
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/libs/ncurses/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile
index 0fcc388840..b6b9a4eb89 100644
--- a/package/libs/ncurses/Makefile
+++ b/package/libs/ncurses/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ncurses
 PKG_CPE_ID:=cpe:/a:gnu:ncurses
 PKG_VERSION:=6.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
@@ -52,7 +52,7 @@ define Package/libncurses-dev
   TITLE:=Development files for the ncurses library
 endef
 
-TARGET_CFLAGS += $(FPIC)
+TARGET_CFLAGS += $(FPIC) -std=gnu17
 
 CONFIGURE_ARGS += \
 	--enable-echo \




More information about the lede-commits mailing list