From 2cc84e1ca8b6d37c55580a81dfc59a00783ac075 Mon Sep 17 00:00:00 2001 From: Shengwen Cheng Date: Tue, 27 Aug 2024 12:07:30 +0800 Subject: [PATCH] Bump Buildroot version and select GCC 14 with binutils 2.42 This commit intends to avoid a recent glibc bug that mistakenly uses 64-bit time on 32-bit machines. Consider the Linux `input_event` structure: struct input_event { struct timeval time; __u16 type; __u16 code; __s32 value; }; On RV32 Linux, the total size of this structure should be 16 bytes (8+2+2+4). However, due to a known glibc bug [2] that incorrectly utilizes the 64-bit time type, the actual size of the structure becomes 24 bytes (16+2+2+4). Without this fix, the bug would affect the usage of DirectFB2 in the semu project. Fortunately, upgrading the toolchain version resolves the issue. [1] https://lore.kernel.org/lkml/caa041d27b0fa45aad09a9a262038e3ae4099ca2.camel@mwa.re/T/ [2] https://sourceware.org/pipermail/libc-help/2024-January/006563.html --- configs/buildroot.config | 8 ++++---- scripts/build-image.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configs/buildroot.config b/configs/buildroot.config index 5b83330..6f51a68 100644 --- a/configs/buildroot.config +++ b/configs/buildroot.config @@ -22,13 +22,13 @@ BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_TOOLCHAIN_BUILDROOT_LIBC="glibc" # BR2_TOOLCHAIN_BUILDROOT_CXX is not set BR2_KERNEL_HEADERS_6_1=y -BR2_BINUTILS_VERSION_2_41_X=y +BR2_BINUTILS_VERSION_2_42_X=y # BR2_BINUTILS_GPROFNG is not set -BR2_GCC_VERSION_12_X=y +BR2_GCC_VERSION_14_X=y BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-softfloat" BR2_TOOLCHAIN_HEADERS_AT_LEAST="6.1" -BR2_TOOLCHAIN_GCC_AT_LEAST_12=y -BR2_TOOLCHAIN_GCC_AT_LEAST="12" +BR2_TOOLCHAIN_GCC_AT_LEAST_14=y +BR2_TOOLCHAIN_GCC_AT_LEAST="14" BR2_SSP_NONE=y # BR2_SSP_REGULAR is not set # BR2_SSP_STRONG is not set diff --git a/scripts/build-image.sh b/scripts/build-image.sh index 5e5c82c..77916b5 100755 --- a/scripts/build-image.sh +++ b/scripts/build-image.sh @@ -21,7 +21,7 @@ PARALLEL="-j$(nproc)" function do_buildroot { - ASSERT git clone https://github.com/buildroot/buildroot -b 2024.02.x --depth=1 + ASSERT git clone https://github.com/buildroot/buildroot -b 2024.05.2 --depth=1 cp -f configs/buildroot.config buildroot/.config cp -f configs/busybox.config buildroot/busybox.config # Otherwise, the error below raises: