diff mbox

[U-Boot,v3,04/62] Makefile: Allow the SPL final link rule to be overridden

Message ID 1467655123-29441-5-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 4, 2016, 5:57 p.m. UTC
Overriding the final link rule is possible with U-Boot proper. It us used to
create a sandbox image links with host libraries. To build a sandbox SPL
image we need the same feature for SPL.

To support this, update the SPL link rule so sandbox can override it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 scripts/Makefile.spl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Simon Glass July 15, 2016, 3:57 a.m. UTC | #1
On 4 July 2016 at 11:57, Simon Glass <sjg@chromium.org> wrote:
> Overriding the final link rule is possible with U-Boot proper. It us used to
> create a sandbox image links with host libraries. To build a sandbox SPL
> image we need the same feature for SPL.
>
> To support this, update the SPL link rule so sandbox can override it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  scripts/Makefile.spl | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied to u-boot-dm
diff mbox

Patch

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 0997fd9..2b5c995 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -241,8 +241,10 @@  cmd_mksunxiboot = $(objtree)/tools/mksunxiboot $< $@
 $(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin FORCE
 	$(call if_changed,mksunxiboot)
 
-quiet_cmd_u-boot-spl = LD      $@
-      cmd_u-boot-spl = (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
+# Rule to link u-boot-spl
+# May be overridden by arch/$(ARCH)/config.mk
+quiet_cmd_u-boot-spl ?= LD      $@
+      cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
 		       $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
 		       $(patsubst $(obj)/%,%,$(u-boot-spl-main)) --end-group \
 		       $(PLATFORM_LIBS) -Map $(SPL_BIN).map -o $(SPL_BIN))