Skip to content

Commit

Permalink
Bump Buildroot version and select GCC 14 with binutils 2.42
Browse files Browse the repository at this point in the history
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/[email protected]/T/
[2] https://sourceware.org/pipermail/libc-help/2024-January/006563.html
  • Loading branch information
shengwen-tw committed Aug 26, 2024
1 parent 207a4d7 commit 2cc84e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions configs/buildroot.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2cc84e1

Please sign in to comment.