[PATCH v2 29/30] Makefile: Drop unwind tables for MSYS

Simon Glass sjg at chromium.org
Sun Apr 30 03:30:02 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>
---

(no changes since v1)

 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 aaae37d50a43..e751e452214e 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.1.495.gc816e09b53d-goog



More information about the U-Boot mailing list