From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Thu, 20 May 2021 13:24:07 +0200 Subject: [PATCH u-boot v4 18/36] sandbox: make LTO available In-Reply-To: <20210520112425.25166-1-marek.behun@nic.cz> References: <20210520112425.25166-1-marek.behun@nic.cz> Message-ID: <20210520112425.25166-19-marek.behun@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Make LTO available for sandbox architecture. Signed-off-by: Marek Beh?n Reviewed-by: Bin Meng --- arch/Kconfig | 1 + arch/sandbox/config.mk | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 6c4b81a486..c5c03d438c 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -101,6 +101,7 @@ config RISCV config SANDBOX bool "Sandbox" + select ARCH_SUPPORTS_LTO select BOARD_LATE_INIT select BZIP2 select CMD_POWEROFF diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 2149771324..1f8cb61c8b 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -17,16 +17,20 @@ PLATFORM_CPPFLAGS += $(shell $(SDL_CONFIG) --cflags) endif cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds $(u-boot-init) \ + $(LTO_FINAL_LDFLAGS) \ -Wl,--whole-archive \ $(u-boot-main) \ + $(u-boot-keep-syms-lto) \ -Wl,--no-whole-archive \ $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T u-boot-spl.lds \ + $(LTO_FINAL_LDFLAGS) \ $(patsubst $(obj)/%,%,$(u-boot-spl-init)) \ -Wl,--whole-archive \ $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \ $(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) \ + $(patsubst $(obj)/%,%,$(u-boot-spl-keep-syms-lto)) \ -Wl,--no-whole-archive \ $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections) -- 2.26.3