arrfab / rpms / shim

Forked from rpms/shim 5 years ago
Clone

Blame SOURCES/0008-allow-32-bit-compilation-with-64-bit-compiler.patch

f2fa6b
From 9712a7e77dc12f7569858b81d620d85301f50ede Mon Sep 17 00:00:00 2001
f2fa6b
From: Andrew Boie <andrew.p.boie@intel.com>
f2fa6b
Date: Mon, 11 Nov 2013 16:17:20 -0800
f2fa6b
Subject: [PATCH 08/19] allow 32-bit compilation with 64-bit compiler
f2fa6b
f2fa6b
Also removed unused LIB_PATH from some Makefiles.
f2fa6b
f2fa6b
Change-Id: I7d28d18f7531b51b6121a2ffb88bcaedec57c467
f2fa6b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
f2fa6b
---
f2fa6b
 Cryptlib/Makefile         | 5 +++--
f2fa6b
 Cryptlib/OpenSSL/Makefile | 4 +---
f2fa6b
 Makefile                  | 3 +++
f2fa6b
 lib/Makefile              | 3 +++
f2fa6b
 4 files changed, 10 insertions(+), 5 deletions(-)
f2fa6b
f2fa6b
diff --git a/Cryptlib/Makefile b/Cryptlib/Makefile
f2fa6b
index a05a4db..d24e59e 100644
f2fa6b
--- a/Cryptlib/Makefile
f2fa6b
+++ b/Cryptlib/Makefile
f2fa6b
@@ -1,7 +1,5 @@
f2fa6b
 ARCH		= $(shell uname -m | sed s,i[3456789]86,ia32,)
f2fa6b
 
f2fa6b
-LIB_PATH	= /usr/lib64
f2fa6b
-
f2fa6b
 EFI_INCLUDE	= /usr/include/efi
f2fa6b
 EFI_INCLUDES	= -nostdinc -IInclude -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol
f2fa6b
 EFI_PATH	= /usr/lib64/gnuefi
f2fa6b
@@ -14,6 +12,9 @@ CFLAGS		= -ggdb -O0 -I. -fno-stack-protector -fno-strict-aliasing -fpic -fshort-
f2fa6b
 ifeq ($(ARCH),x86_64)
f2fa6b
 	CFLAGS	+= -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI
f2fa6b
 endif
f2fa6b
+ifeq ($(ARCH),ia32)
f2fa6b
+	CFLAGS	+= -m32
f2fa6b
+endif
f2fa6b
 LDFLAGS		= -nostdlib -znocombreloc
f2fa6b
 
f2fa6b
 TARGET		= libcryptlib.a
f2fa6b
diff --git a/Cryptlib/OpenSSL/Makefile b/Cryptlib/OpenSSL/Makefile
f2fa6b
index 3d5a87c..8e2f2a6 100644
f2fa6b
--- a/Cryptlib/OpenSSL/Makefile
f2fa6b
+++ b/Cryptlib/OpenSSL/Makefile
f2fa6b
@@ -1,7 +1,5 @@
f2fa6b
 ARCH		= $(shell uname -m | sed s,i[3456789]86,ia32,)
f2fa6b
 
f2fa6b
-LIB_PATH	= /usr/lib64
f2fa6b
-
f2fa6b
 EFI_INCLUDE	= /usr/include/efi
f2fa6b
 EFI_INCLUDES	= -I../Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol
f2fa6b
 EFI_PATH	= /usr/lib64/gnuefi
f2fa6b
@@ -15,7 +13,7 @@ ifeq ($(ARCH),x86_64)
f2fa6b
 	CFLAGS	+= -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI -DSIXTY_FOUR_BIT_LONG
f2fa6b
 endif
f2fa6b
 ifeq ($(ARCH),ia32)
f2fa6b
-	CFLAGS	+= -DTHIRTY_TWO_BIT
f2fa6b
+	CFLAGS	+= -m32 -DTHIRTY_TWO_BIT
f2fa6b
 endif
f2fa6b
 LDFLAGS		= -nostdlib -znocombreloc
f2fa6b
 
f2fa6b
diff --git a/Makefile b/Makefile
f2fa6b
index d619ff4..e65d28d 100644
f2fa6b
--- a/Makefile
f2fa6b
+++ b/Makefile
f2fa6b
@@ -28,6 +28,9 @@ endif
f2fa6b
 ifeq ($(ARCH),x86_64)
f2fa6b
 	CFLAGS	+= -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI
f2fa6b
 endif
f2fa6b
+ifeq ($(ARCH),ia32)
f2fa6b
+	CFLAGS	+= -m32
f2fa6b
+endif
f2fa6b
 ifneq ($(origin VENDOR_CERT_FILE), undefined)
f2fa6b
 	CFLAGS += -DVENDOR_CERT_FILE=\"$(VENDOR_CERT_FILE)\"
f2fa6b
 endif
f2fa6b
diff --git a/lib/Makefile b/lib/Makefile
f2fa6b
index adb0347..a9c9cf6 100644
f2fa6b
--- a/lib/Makefile
f2fa6b
+++ b/lib/Makefile
f2fa6b
@@ -17,6 +17,9 @@ CFLAGS          = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic \
f2fa6b
 ifeq ($(ARCH),x86_64)
f2fa6b
         CFLAGS  += -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI
f2fa6b
 endif
f2fa6b
+ifeq ($(ARCH),ia32)
f2fa6b
+        CFLAGS  += -m32
f2fa6b
+endif
f2fa6b
 
f2fa6b
 lib.a: $(LIBFILES)
f2fa6b
 	ar rcs lib.a $(LIBFILES)
f2fa6b
-- 
f2fa6b
1.8.5.3
f2fa6b