]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sandbox: Drop special link order treatment of start.o and sdl.o
authorTom Rini <trini@konsulko.com>
Wed, 20 May 2026 00:09:52 +0000 (18:09 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 4 Jun 2026 18:27:16 +0000 (12:27 -0600)
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
"extra-".

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
arch/sandbox/Makefile
arch/sandbox/cpu/Makefile

index 5bbf9f1f96bb2d25249b84ae908cdf2b9c0c0803..0360d2bd8861bfb7af4a0f738725f12857b84942 100644 (file)
@@ -1,13 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-head-y := arch/sandbox/cpu/start.o
-head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
 libs-y += arch/sandbox/cpu/
 libs-y += arch/sandbox/lib/
-
-# sdl.c fails to compile with -fshort-wchar using musl.
-cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
-       $(patsubst -I%,-idirafter%,$(c_flags))) -fno-lto -c -o $@ $<
-
-$(obj)/sdl.o: $(src)/sdl.c FORCE
-       $(call if_changed_dep,cc_sdl.o)
index ee3c04c49e14a47411b6da752fb8245327df0d3b..eb6bf6302e23d04cb241b2f8df57d884072a415a 100644 (file)
@@ -5,9 +5,8 @@
 # (C) Copyright 2000-2003
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
-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
 obj-$(CONFIG_XPL_BUILD)        += spl.o
 obj-$(CONFIG_ETH_SANDBOX_RAW)  += eth-raw-os.o