From 9d6b441ec581a2df92ccde627ab6ec8dfbb31ce6 Mon Sep 17 00:00:00 2001 From: Nigel Croxon Date: Tue, 25 Jun 2013 08:47:03 -0400 Subject: [PATCH] be more pedantic when linking Don't allow duplicate symbols, abort upon first error. also make sure the linker script comes last for apps. Signed-off-by: David Decotigny --- gnu-efi-3.0/Make.defaults | 2 +- gnu-efi-3.0/apps/Makefile | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gnu-efi-3.0/Make.defaults b/gnu-efi-3.0/Make.defaults index a22a1b4..6b4b6de 100644 --- a/gnu-efi-3.0/Make.defaults +++ b/gnu-efi-3.0/Make.defaults @@ -114,4 +114,4 @@ CFLAGS += $(ARCH3264) -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing \ -fno-merge-constants -ffreestanding -fno-stack-protector \ -fno-stack-check ASFLAGS += $(ARCH3264) -LDFLAGS += -nostdlib --no-undefined +LDFLAGS += -nostdlib --warn-common --no-undefined --fatal-warnings diff --git a/gnu-efi-3.0/apps/Makefile b/gnu-efi-3.0/apps/Makefile index 773bc08..6834e14 100644 --- a/gnu-efi-3.0/apps/Makefile +++ b/gnu-efi-3.0/apps/Makefile @@ -52,8 +52,12 @@ ifneq (,$(findstring FreeBSD,$(OS))) LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds endif -LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) -LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) +LDFLAGS += -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) + +LOADLIBES += -lefi -lgnuefi +LOADLIBES += $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) +LOADLIBES += -T $(LDSCRIPT) + FORMAT = efi-app-$(ARCH) TARGETS = t.efi t2.efi t3.efi t4.efi t5.efi t6.efi printenv.efi t7.efi tcc.efi modelist.efi route80h.efi