Skip to contentSkip to conversation

bash: Stick to C17 std

PATCH In review [email protected] 2 participants 3 messages Aug 17, 2025 – Aug 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 bash: Stick to C17 std

From: Khem Raj <[email protected]>

GCC 15 defaults to C23 and bash is not yet ready for that so keep using C17 like GCC 14 for now

---
 meta/recipes-extended/bash/bash_5.2.21.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-extended/bash/bash_5.2.21.bb +2 -0
index ccfe5c47a7..42ab02c440 100644
@@ -22,4 +22,6 @@ SRC_URI[tarball.sha256sum] = "c8e31bdc59b69aaffc5b36509905ba3e5cbb12747091d27b4b
 DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 
+CFLAGS += "-std=gnu17"
+
 BBCLASSEXTEND = "nativesdk"
#1 lore raw

PATCH 2/2 bash: use -std=gnu17 also for native CFLAGS

From: Martin Jansa <[email protected]>

* fixes builds on host with gcc-15:
http://errors.yoctoproject.org/Errors/Details/853016/

../../bash-5.2.37/builtins/mkbuiltins.c:268:29: error: too many arguments to function ‘xmalloc’; expected 0, have 1

  268 |           error_directory = xmalloc (2 + strlen (argv[arg_index]));
      |                             ^~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 meta/recipes-extended/bash/bash_5.2.21.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-extended/bash/bash_5.2.21.bb +3 -0
index 42ab02c440..7652e7d87a 100644
@@ -23,5 +23,8 @@ DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb
 DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 
 CFLAGS += "-std=gnu17"
+# mkbuiltins.c is built with native toolchain and needs gnu17 as well:
+# http://errors.yoctoproject.org/Errors/Details/853016/
+BUILD_CFLAGS += "-std=gnu17"
 
 BBCLASSEXTEND = "nativesdk"
#2 lore raw
In reply to [email protected]

Hi Martin,

Quoted 3 lines · Martin Jansa via lists.openembedded.org

From: Khem Raj <[email protected]>

GCC 15 defaults to C23 and bash is not yet ready for that

Same remark as for the other series, do we actually support a distro for Scarthgap that has a GCC 15+ toolchain in its package feed?

Quoted 30 lines

so keep using C17 like GCC 14 for now

---
  meta/recipes-extended/bash/bash_5.2.21.bb | 2 ++
  1 file changed, 2 insertions(+)
meta/recipes-extended/bash/bash_5.2.21.bb +2 -1
index ccfe5c47a7..42ab02c440 100644
@@ -22,4 +22,6 @@ SRC_URI[tarball.sha256sum] = "c8e31bdc59b69aaffc5b36509905ba3e5cbb12747091d27b4b
  DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
  DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 
+CFLAGS += "-std=gnu17"
+
  BBCLASSEXTEND = "nativesdk"
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#222028): https://lists.openembedded.org/g/openembedded-core/message/222028
Mute This Topic: https://lists.openembedded.org/mt/114755403/6293953
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-