boot/syslinux: add -std=gnu17 only for gcc >= 8
PATCH 1/1 boot/syslinux: add -std=gnu17 only for gcc >= 8
Buildroot commit f5101638b9f917dc4c569828ff3fee0c486ba8f8 unconditionally added -std=gnu17 breaking the build with older gcc versions:
https://lists.buildroot.org/pipermail/buildroot/2025-August/784453.html
Reported-by "Thomas Petazzoni <[email protected]>"
Signed-off-by Bernd Kuhls <[email protected]>
--- boot/syslinux/syslinux.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
boot/syslinux/syslinux.mk +4 -1
@@ -56,6 +56,9 @@ SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP # syslinux build system has no convenient way to pass CFLAGS, # and the internal zlib should take precedence so -I shouldn't # be used. +# gcc-15 defaults to -std=gnu23 which introduces build failures. +# We force "-std=gnu17" for gcc version supporting it. Earlier gcc +# versions will work, since they are using the older standard. # Install in a temporary location that eases final install into # images/ (see corresponding command, below). # Repeat the target, otherwise syslinux will try to build everything
@@ -65,7 +68,7 @@ define SYSLINUX_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE1) \ ASCIIDOC_OK=-1 \ A2X_XML_OK=-1 \ - CC="$(TARGET_CC) -std=gnu17" \ + CC="$(TARGET_CC) $(if $(BR2_TOOLCHAIN_GCC_AT_LEAST_8),-std=gnu17)" \ LD="$(TARGET_LD)" \ OBJCOPY="$(TARGET_OBJCOPY)" \ AS="$(TARGET_AS)" \
Signature · 6 lines
2.47.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 6 lines · Bernd Kuhls
Buildroot commit
f5101638b9f917dc4c569828ff3fee0c486ba8f8unconditionally added -std=gnu17 breaking the build with older gcc versions:
https://lists.buildroot.org/pipermail/buildroot/2025-August/784453.htmlReported-by "Thomas Petazzoni <[email protected]>"Signed-off-by Bernd Kuhls <[email protected]>
Applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot