diff --git a/boot/syslinux/syslinux.mk b/boot/syslinux/syslinux.mk index b8f022b189..f938634c35 100644 --- a/boot/syslinux/syslinux.mk +++ b/boot/syslinux/syslinux.mk @@ -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)" \