Skip to content

Commit e624ccb

Browse files
committed
odroidc1: fix u-boot build on trixie (GCC 14 promoted-to-error warnings)
CI "Build All Artifacts" fails uboot-odroidc1-current on the trixie host. The 2011-era hardkernel Amlogic u-boot (odroidc-v2011.03) hits a pile of warnings that GCC 14 now treats as hard errors by default: board.c:30: -Wint-conversion (pointer from integer) board.c:512: implicit declaration of 'get_dev_by_name' board.c:739: implicit declaration of 'vpu_probe' bootm.c:281: implicit declaration of 'amlogic_gpio_direction_output' gpio.c:332/333: implicit declaration of 'malloc' / 'free' gpio.c:850+: -Wincompatible-pointer-types (function pointer mismatches) It built on noble/GCC 13. Add a post_config_uboot_target hook that appends the four -Wno-error= flags to uboot_cflags_array (same mechanism as the odroidxu4 and rockchip-rv1106 GCC-downgrade hooks), including -Wno-error=int-conversion for the pervasive pointer<->integer cases. ARCH=armhf, so int and pointer are the same width and those conversions are benign; the implicit-decl symbols resolve at link time. Keeps the known-good hardkernel boot chain unchanged. Signed-off-by: Igor Pecovnik <igor@armbian.com>
1 parent a0e9e38 commit e624ccb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

config/boards/odroidc1.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,20 @@ write_uboot_platform() {
2626
dd if=$1/u-boot.bin of=$2 bs=512 seek=64 conv=fsync > /dev/null 2>&1
2727
dd if=/dev/zero of=$2 seek=1024 count=32 bs=512 conv=fsync > /dev/null 2>&1
2828
}
29+
30+
# GCC 14 (trixie host) promotes -Wint-conversion, -Wimplicit-function-declaration,
31+
# -Wimplicit-int and -Wincompatible-pointer-types from warning to hard error. This
32+
# 2011-era hardkernel Amlogic u-boot (odroidc-v2011.03) trips on all of them
33+
# (board.c / gpio.c / bootm.c: get_dev_by_name, vpu_probe, amlogic_gpio_*, malloc,
34+
# pointer-from-integer, ...). It built on noble/GCC 13; downgrade back to warnings
35+
# so it builds on trixie. ARCH=armhf, so the int<->pointer conversions are
36+
# same-width and benign.
37+
function post_config_uboot_target__odroidc1_downgrade_gcc14_errors() {
38+
uboot_cflags_array+=(
39+
"-Wno-error=implicit-function-declaration"
40+
"-Wno-error=implicit-int"
41+
"-Wno-error=int-conversion"
42+
"-Wno-error=incompatible-pointer-types"
43+
)
44+
return 0
45+
}

0 commit comments

Comments
 (0)