Skip to contentSkip to conversation

package/make: fix build with gcc 15.x

PATCH In review Bernd Kuhls 2 participants 2 messages Feb 9 – Feb 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/make: fix build with gcc 15.x

https://www.mail-archive.com/[email protected]/msg16254.html
"GNU Make avoids importing Gnulib modules, since it will make
bootstrapping harder.
[...]
So, you should be able to compile with -std=gnu99."

Fixes:
https://autobuild.buildroot.net/results/e92/e9250f1bdbbd7c65a8bd108f32ad9eef73a3eacf/

---
 package/make/make.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/make/make.mk +4 -0
index 1d1a976eb4..6da857af74 100644
@@ -14,6 +14,10 @@ MAKE_CPE_ID_VENDOR = gnu
 
 MAKE_CONF_OPTS = --without-guile
 
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_15),y)
+MAKE_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
+endif
+
 # Disable the 'load' operation for static builds since it needs dlopen
 ifeq ($(BR2_STATIC_LIBS),y)
 MAKE_CONF_OPTS += --disable-load
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Bernd,

Quoted 3 lines · Bernd Kuhls

https://www.mail-archive.com/[email protected]/msg16254.html
"GNU Make avoids importing Gnulib modules, since it will make
bootstrapping harder.

I don't think this part is relevant at all to your patch, right?

Quoted 5 lines

[...]
So, you should be able to compile with -std=gnu99."

Fixes:
https://autobuild.buildroot.net/results/e92/e9250f1bdbbd7c65a8bd108f32ad9eef73a3eacf/

I can confirm that, but I'd ideally like to understand what's going on here a bit more. The failure seems to only occur with gcc 15 and musl libc. It builds fine with gcc 15 and both glibc and uclib-ng.

Could you try to find out more why this is specifically a musl problem?

Alpine has a patch that looks relevant as well, but unfortunately without any details: https://github.com/alpinelinux/aports/blob/master/main/make/getopt-gcc15.patch

But maybe a version of this could be submitted to make upstream to have it fixed on all C libraries?

Or maybe this is the correct fix for now, but still we should find out more why this is only happening with musl.

Quoted 1 line

[...]

Best,
Marcus
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot