arrfab / rpms / shim

Forked from rpms/shim 4 years ago
Clone
Blob Blame History Raw
From d3a8eedee05c8991117a8efb8bfa3fe606d6c2e9 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 25 Feb 2015 16:34:28 -0500
Subject: [PATCH 2/2] Make lib/ use the right CFLAGS.

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 Makefile      |  4 ++--
 lib/Makefile  | 11 -----------
 lib/console.c |  4 ++--
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 332a29b..532bcf3 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ SUBDIRS		= Cryptlib lib
 LIB_PATH	= /usr/lib64
 
 EFI_INCLUDE	:= /usr/include/efi
-EFI_INCLUDES	= -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -Iinclude
+EFI_INCLUDES	= -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I$(shell pwd)/include
 EFI_PATH	:= /usr/lib64/gnuefi
 
 LIB_GCC		= $(shell $(CC) -print-libgcc-file-name)
@@ -115,7 +115,7 @@ Cryptlib/OpenSSL/libopenssl.a:
 	$(MAKE) -C Cryptlib/OpenSSL
 
 lib/lib.a:
-	$(MAKE) -C lib
+	$(MAKE) CFLAGS="$(CFLAGS)" -C lib
 
 ifeq ($(ARCH),aarch64)
 FORMAT		:= -O binary
diff --git a/lib/Makefile b/lib/Makefile
index ebd21a1..d93a26d 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -4,17 +4,6 @@ LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variab
 
 EFI_INCLUDES    = -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I../include
 
-CFLAGS          = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic \
-		  -fshort-wchar -Wall -DBUILD_EFI -fno-builtin -Werror \
-		  $(EFI_INCLUDES)
-
-ifeq ($(ARCH),x86_64)
-        CFLAGS  += -mno-red-zone -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI
-endif
-ifeq ($(ARCH),ia32)
-        CFLAGS  += -mno-red-zone -m32
-endif
-
 lib.a: $(LIBFILES)
 	ar rcs lib.a $(LIBFILES)
 
diff --git a/lib/console.c b/lib/console.c
index 10bc154..e70ab48 100644
--- a/lib/console.c
+++ b/lib/console.c
@@ -4,8 +4,8 @@
  *
  * see COPYING file
  */
-#include <efi/efi.h>
-#include <efi/efilib.h>
+#include <efi.h>
+#include <efilib.h>
 
 #include <console.h>
 #include <variables.h>
-- 
2.1.0