Hi Tom, On 2026-05-22T21:27:48, Rasmus Villemoes <[email protected]> wrote: > sandbox: Drop special link order treatment of start.o and sdl.o > > On hardware architectures, we need to treat start.o (generated from > start.S) very special due to the constraints of being a program running > on hardware in an unknown state. These objects are treated a little > different than the rest by the linker and linker scripts on various > architectures. > > Sandbox is different, and doesn't need to do that. In fact, it can lead > to hard to diagnose problems because of just how subtly different the > treatment is. For example, the comment about LTO in include/event.h > introduced with commit 87a5d1b5d012 ("event: Add basic support for > events") was only a sandbox issue because of the event in start.c and > in turn linking start.o isn't treated the same way as an archive with > all its sections considered. > > Correct all of this by removing the 'head-' lines for cpu.o and sdl.o > from arch/sandbox/Makefile (and unused cmd_cc_sdl.o lines) and change > arch/sandbox/cpu/Makefile to treating them both with 'obj-' and not
to treat them both > 'extra-'. > [...] > > arch/sandbox/Makefile | 9 --------- > arch/sandbox/cpu/Makefile | 5 ++--- > 2 files changed, 2 insertions(+), 12 deletions(-) > diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile > @@ -5,9 +5,8 @@ > # (C) Copyright 2000-2003 > # Wolfgang Denk, DENX Software Engineering, [email protected]. > > -obj-y := cache.o cpu.o state.o initjmp.o os.o > -extra-y := start.o > -extra-$(CONFIG_SANDBOX_SDL) += sdl.o > +obj-y := start.o cache.o cpu.o state.o initjmp.o os.o > +obj-$(CONFIG_SANDBOX_SDL) += sdl.o The sandbox-specific cmd_cc_sdl.o override already covers sdl.o once it moves into obj-y, so dropping the duplicate block from arch/sandbox/Makefile looks safe Reviewed-by: Simon Glass <[email protected]>

