[PATCH 30/31] Makefile: Drop unwind tables

Simon Glass sjg at chromium.org
Tue Apr 25 01:08:35 CEST 2023


These give lots of warnings for the form:

   lib/efi_loader/helloworld.o:helloworld.c:(.pdata+0x0): relocation
      truncated to fit: IMAGE_REL_AMD64_ADDR32NB against `.text'

The tables are not needed except when debugging, so disable them for now.

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

 lib/efi_loader/Makefile | 8 ++++++++
 scripts/Makefile.lib    | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index 13a35eae6c06..c17d39eba91e 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -15,11 +15,19 @@ CFLAGS_efi_boottime.o += \
 CFLAGS_boothart.o := $(CFLAGS_EFI) -Os -ffreestanding
 CFLAGS_REMOVE_boothart.o := $(CFLAGS_NON_EFI)
 CFLAGS_helloworld.o := $(CFLAGS_EFI) -Os -ffreestanding
+
+ifneq ($(MSYS_VERSION),0)
+CFLAGS_helloworld.o += -fno-asynchronous-unwind-tables -fno-unwind-tables
+endif
+
 CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
 CFLAGS_dtbdump.o := $(CFLAGS_EFI) -Os -ffreestanding
 CFLAGS_REMOVE_dtbdump.o := $(CFLAGS_NON_EFI)
 CFLAGS_initrddump.o := $(CFLAGS_EFI) -Os -ffreestanding
 CFLAGS_REMOVE_initrddump.o := $(CFLAGS_NON_EFI)
+ifneq ($(MSYS_VERSION),0)
+CFLAGS_initrddump.o += -fno-asynchronous-unwind-tables -fno-unwind-tables
+endif
 
 ifdef CONFIG_RISCV
 always += boothart.efi
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index d309e26aaec8..1c3781a751fc 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -450,6 +450,10 @@ targets += $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
 
 CFLAGS_REMOVE_efi_reloc.o := $(LTO_CFLAGS)
 CFLAGS_REMOVE_efi_freestanding.o := $(LTO_CFLAGS)
+ifneq ($(MSYS_VERSION),0)
+CFLAGS_efi_reloc.o += -fno-asynchronous-unwind-tables -fno-unwind-tables
+CFLAGS_efi_freestanding.o += -fno-asynchronous-unwind-tables -fno-unwind-tables
+endif
 
 # ACPI
 # ---------------------------------------------------------------------------
-- 
2.40.0.634.g4ca3ef3211-goog



More information about the U-Boot mailing list