EFI: Remove SHARED=false usage by enforcing -no-undefined

We've been using SHARED=false to capture unported stuff. However it can be
captured using -no-undefined. This patch removes SHARED option and adds
-no-undefined. Original by Marcelo Ferreira <joamarcelo@gmail.com>,
Improved by Lv Zheng <lv.zheng@intel.com>

Signed-off-by: Marcelo Ferreira <joamarcelo@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This commit is contained in:
Marcelo Ferreira 2016-07-22 23:48:12 +08:00 committed by Lv Zheng
parent 37131916c8
commit 80a01a2af2

View File

@ -27,15 +27,6 @@
# OPT_CFLAGS Optimization CFLAGS can be overridden on the make command # OPT_CFLAGS Optimization CFLAGS can be overridden on the make command
# line by adding the followings to the invocation: # line by adding the followings to the invocation:
# OPT_CFLAGS="..." # OPT_CFLAGS="..."
# SHARED Testing build to check if symbols are not implemented.
# GCC won't complain missing of symbols as our programs are
# compiled with -shared. This can be overridden on the make
# command line by adding the followings to the invocation:
# SHARED=false
# Link failures should only be seen for the _start and
# DivU64x32. They are the only 2 GNU EFI functions we are
# using in order not to introduce architecture specific code
# into ACPICA.
# #
# Notes: # Notes:
# gcc should be version 4 or greater, otherwise some of the options # gcc should be version 4 or greater, otherwise some of the options
@ -50,7 +41,6 @@
PROGS = acpidump PROGS = acpidump
HOST = $(shell uname -m | sed s,i[3456789]86,ia32,) HOST = $(shell uname -m | sed s,i[3456789]86,ia32,)
TARGET = $(shell uname -m | sed s,i[3456789]86,ia32,) TARGET = $(shell uname -m | sed s,i[3456789]86,ia32,)
SHARED ?= true
OBJDIR = obj OBJDIR = obj
BINDIR = bin BINDIR = bin
@ -108,13 +98,9 @@ CFLAGS = \
LDFLAGS = \ LDFLAGS = \
-nostdlib\ -nostdlib\
-znocombreloc\ -znocombreloc\
-Bsymbolic -Bsymbolic\
ifeq ($(strip $(SHARED)), true) -shared\
LDFLAGS += \ -no-undefined
-shared
endif
LIBS = \
$(shell $(CC) -print-libgcc-file-name)
OBJCOPYFLAGS = \ OBJCOPYFLAGS = \
-j .text\ -j .text\
-j .sdata\ -j .sdata\
@ -219,9 +205,10 @@ LDFLAGS += \
-T $(EFILIB)/elf_$(TARGET)_efi.lds\ -T $(EFILIB)/elf_$(TARGET)_efi.lds\
-L$(EFILIB)\ -L$(EFILIB)\
$(EFILIB)/crt0-efi-$(TARGET).o $(EFILIB)/crt0-efi-$(TARGET).o
LIBS += \ LIBS = \
-lefi\ -lefi\
-lgnuefi\ -lgnuefi\
$(shell $(CC) -print-libgcc-file-name)
# #
# Bison/Flex configuration # Bison/Flex configuration