Skip to contentSkip to conversation

sandbox: Adjust how OS-interface files are built

PATCH In review Simon Glass 2 participants 2 messages Mar 24 – Apr 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sandbox: Adjust how OS-interface files are built

The current mechanism uses a completely separate build rule for each file which must be built with system headers. This is tricky to maintain.

Add a foreach template in the sandbox cpu Makefile which generates the custom compile rules from a CFLAGS_USE_SYSHDRS list. This keeps the rules data-driven without needing changes to the common scripts/Makefile.lib, which could affect other architectures.

Move initjmp.o into the template since it uses the same pattern. Add sdl.o to the list too, with an override for its command since it also needs -fshort-wchar removed and -fno-lto added.

---

 arch/sandbox/Makefile     |  2 +-
 arch/sandbox/cpu/Makefile | 45 ++++++++++++++-------------------------
 2 files changed, 17 insertions(+), 30 deletions(-)
arch/sandbox/Makefile +1 -1
index a335f8acfde..5bbf9f1f96b 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
+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/
arch/sandbox/cpu/Makefile +16 -29

58 lines not on this page · raw message

Signature · 4 lines
2.43.0

base-commit: 1ffc541eafc96d5eebcf837ab892dccec3b93568
branch: sb-os-us
#1 lore raw
Quoted 10 lines · Simon Glass

The current mechanism uses a completely separate build rule for each file which must be built with system headers. This is tricky to maintain.

Add a foreach template in the sandbox cpu Makefile which generates the custom compile rules from a CFLAGS_USE_SYSHDRS list. This keeps the rules data-driven without needing changes to the common scripts/Makefile.lib, which could affect other architectures.

[...]

Applied to u-boot/master, thanks!

[1/1] sandbox: Adjust how OS-interface files are built

      commit: 738428dc0e761617c5196a5210774ac7347e6bb7
Signature · 1 line
Tom