From ebac6922d1f6fc16c5d3953dfb512553001dcdd3 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Thu, 19 Jan 2023 20:06:04 +0000 Subject: [PATCH] fix(build): allow warnings when using lld After https://reviews.llvm.org/D118840, ld.lld reports below section type mismatch warnings: LD trusted-firmware-a/build/qemu/release/bl1/bl1.elf ld.lld: error: section type mismatch for base_xlat_table >>> trusted-firmware-a/build/qemu/release/bl1/xlat_tables_context.o: (base_xlat_table): SHT_PROGBITS >>> output section .bss: SHT_NOBITS ld.lld: error: section type mismatch for xlat_table >>> trusted-firmware-a/build/qemu/release/bl1/xlat_tables_context.o: (xlat_table): SHT_PROGBITS >>> output section xlat_table: SHT_NOBITS So allow warnings to make build pass. Change-Id: I70503ad03b3be7a18ffe29ef6f2127c3f4d540f1 Signed-off-by: Yabin Cui --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f4d623eca..8f859fc6a 100644 --- a/Makefile +++ b/Makefile @@ -468,12 +468,14 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other else -TF_LDFLAGS += --fatal-warnings -O1 +TF_LDFLAGS += -O1 TF_LDFLAGS += --gc-sections # ld.lld doesn't recognize the errata flags, -# therefore don't add those in that case +# therefore don't add those in that case. +# ld.lld reports section type mismatch warnings, +# therefore don't add --fatal-warnings to it. ifeq ($(findstring ld.lld,$(notdir $(LD))),) -TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) +TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) --fatal-warnings endif endif