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:23 +0200 Subject: [PATCH u-boot v4 34/36] ARM: don't use -ffunction-sections/-fdata-sections with LTO build In-Reply-To: <20210520112425.25166-1-marek.behun@nic.cz> References: <20210520112425.25166-1-marek.behun@nic.cz> Message-ID: <20210520112425.25166-35-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 When building with LTO, using -ffunction-sections/-fdata-sections is not useful anymore. Signed-off-by: Marek Beh?n --- arch/arm/config.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index e79f0104b9..f556ee3329 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -16,8 +16,12 @@ CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections \ CFLAGS_EFI := -fpic -fshort-wchar LDFLAGS_FINAL += --gc-sections -PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \ - -fno-common -ffixed-r9 + +ifndef CONFIG_LTO +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections +endif + +PLATFORM_RELFLAGS += -fno-common -ffixed-r9 PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \ $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -- 2.26.3