From 6b2845beba3938dd350a889f8d918f7473f8c6ff Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 20 Jun 2026 08:22:45 +0700 Subject: hw/bsp/ch58x: put linker flags in LDFLAGS so the make build links family.mk listed -nostartfiles and the nano/nosys specs under LDFLAGS_GCC, a variable the make build system never reads (only LDFLAGS / LDFLAGS_CLANG are consumed by gcc_rules.mk). So the make build linked the toolchain's crt0.o alongside the SDK's startup_CH583.S and failed with "multiple definition of _start" + an undefined __bss_start, and also pulled in full newlib (RAM blew up). Rename it to LDFLAGS, matching ch32v20x/family.mk. The cmake build was unaffected (it sets these via target_link_options). Fixes the CircleCI one-random-make-ch58x build. Co-Authored-By: Claude Opus 4.8 (1M context) --- hw/bsp/ch58x/family.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/bsp/ch58x/family.mk b/hw/bsp/ch58x/family.mk index 36ce254fc..ccdaa7268 100644 --- a/hw/bsp/ch58x/family.mk +++ b/hw/bsp/ch58x/family.mk @@ -26,7 +26,7 @@ CFLAGS += \ -DINT_SOFT \ -Wno-error=strict-prototypes -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ -- cgit v1.3.1