Skip to content

MIPS: fix building and linking of standalone programs

Daniel Schwierzeck u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Kbuild: add LDFLAGS_STANDALONEarch/mips/cpu/mips32/config.mk arch/mips/cpu/mips64/config.mk arch/nds32/config.mk +4 more+14 -100 replies
1/3Kbuild: add LDFLAGS_STANDALONE+0 -02 replies
1/3Kbuild: add LDFLAGS_STANDALONE+0 -00 replies
2/3Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGSexamples/standalone/Makefile+2 -20 replies
2/3Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS+0 -01 reply
2/3Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS+0 -00 replies
3/3MIPS: fix linking of standalone programsarch/mips/config.mk arch/mips/cpu/mips32/config.mk arch/mips/cpu/mips64/config.mk +2 more+5 -980 replies
3/3MIPS: fix linking of standalone programs+0 -00 replies

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchTom RiniRick Chen
1/3R-b R-b
1/3R-b R-b
1/3R-b R-b
2/3R-b
2/3R-b
2/3R-b
3/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/3] MIPS: fix building and linking of standalone programs

This series fixes the long-time broken support of standalone programs on MIPS. All MIPS standalone programs now use the main MIPS linker script and all available code size optimizations. Finally the deprecated Makefiles arch/mips/cpu/mips[32,64]/config.mk could be removed.

The series also improves the passing of additional linker flags to standalone programs by introducing a Makefile variable LDFLAGS_STANDALONE. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misused on some archs to pass the path to the linker script. The variable LDFLAGS_STANDALONE now provides a cleaner way to do that. Furthermore it is now possible to migrate CONFIG_STANDALONE_LOAD_ADDR to Kconfig as a hex symbol.

Sample test session with Malta board in Qemu:

U-Boot 2018.09-00270-g19936da8bc (Sep 23 2018 - 18:43:17 +0200)

Board: MIPS Malta CoreLV
DRAM:  256 MiB
Flash: 4 MiB

*** Warning - bad CRC, using default environment

In:    serial at 3f8
Out:   serial at 3f8
Err:   serial at 3f8
Net:   pcnet#0
IDE:   Bus 0: not available

malta #
malta #
malta # dhcp 80200000 hello_world.bin
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (3 ms) Using pcnet#0 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'hello_world.bin'.
Load address: 0x80200000
Loading: ###

	 32.2 MiB/s

done
Bytes transferred = 33784 (83f8 hex)
malta # go 80200000
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
argc = 1
argv[0] = "80200000"
argv[1] = "<NULL>"
Hit any key to exit ...

malta # go 80200000 666
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
argc = 2
argv[0] = "80200000"
argv[1] = "666"
argv[2] = "<NULL>"
Hit any key to exit ...

Daniel Schwierzeck (3):
Kbuild: add LDFLAGS_STANDALONE
Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS
MIPS: fix linking of standalone programs

 arch/mips/config.mk            |  5 ++++
 arch/mips/cpu/mips32/config.mk |  7 ------
 arch/mips/cpu/mips64/config.mk |  7 ------
 arch/nds32/config.mk           |  4 ++--
 arch/riscv/config.mk           |  4 ++--
 arch/sh/config.mk              |  2 +-
 config.mk                      |  2 ++
 examples/standalone/Makefile   |  8 ++++---
 examples/standalone/mips.lds   | 42 ----------------------------------
 examples/standalone/mips64.lds | 42 ----------------------------------
 10 files changed, 17 insertions(+), 106 deletions(-)
 delete mode 100644 arch/mips/cpu/mips32/config.mk
 delete mode 100644 arch/mips/cpu/mips64/config.mk
 delete mode 100644 examples/standalone/mips.lds
 delete mode 100644 examples/standalone/mips64.lds
Signature · 1 line
2.19.0