-fpic is not needed for MinGW, and MinGW32 issues a warning as a

result, which breaks gnu-efi compilation due to -Werror:
gnu-efi/lib/boxdraw.c:1:0: error: -fpic ignored for target
(all code is position independent) [-Werror]

This patch ensures that -fpic is disabled when MinGW is used.

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
This commit is contained in:
Nigel Croxon 2016-03-29 10:16:21 -04:00
parent 58e6955b44
commit 50b883773f

View File

@ -139,12 +139,18 @@ endif
INCDIR += -I$(SRCDIR) -I$(TOPDIR)/inc -I$(TOPDIR)/inc/$(ARCH) \
-I$(TOPDIR)/inc/protocol
# Only enable -fpic for non MinGW compilers (unneeded on MinGW)
GCCMACHINE := $(shell $(CC) -dumpmachine)
ifneq (mingw32,$(findstring mingw32, $(GCCMACHINE)))
CFLAGS += -fpic
endif
ifeq (FreeBSD, $(findstring FreeBSD, $(OS)))
CFLAGS += $(ARCH3264) -g -O2 -fpic -Wall -Wextra -Werror \
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
-ffreestanding -fno-stack-protector
else
CFLAGS += $(ARCH3264) -g -O2 -fpic -Wall -Wextra -Werror \
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
-fno-merge-constants -ffreestanding -fno-stack-protector \
-fno-stack-check