pesign/0003-Fix-paths-for-32-bit-builds.patch

80 lines
2.5 KiB
Diff

From 020edc721159a7aee09bdaef54d22f11f40766d6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 21 Jun 2012 10:16:25 -0400
Subject: [PATCH 3/3] Fix paths for 32-bit builds.
---
Make.defaults | 19 +++++++++----------
util/Makefile | 6 +++---
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/Make.defaults b/Make.defaults
index feda335..50b28b7 100644
--- a/Make.defaults
+++ b/Make.defaults
@@ -11,15 +11,14 @@ LDFLAGS = -nostdlib
CCLDFLAGS = -shared
INSTALL = install
# XXX this is broken
-LIBDIR = $(PREFIX)/lib64
-prefix = /usr/bin/
+bindir = /usr/bin/
-CC = $(prefix)gcc
-AS = $(prefix)as
-LD = $(prefix)ld.bfd
-AR = $(prefix)ar
-RANLIB = $(prefix)ranlib
-OBJCOPY = $(prefix)objcopy
+CC = $(bindir)gcc
+AS = $(bindir)as
+LD = $(bindir)ld.bfd
+AR = $(bindir)ar
+RANLIB = $(bindir)ranlib
+OBJCOPY = $(bindir)objcopy
ifeq ($(ARCH),ia64)
CFLAGS += -mfixed-range=f32-f127
@@ -27,17 +26,17 @@ ifeq ($(ARCH),ia64)
endif
ifeq ($(ARCH), ia32)
+ LIBDIR := $(PREFIX)/lib
ifeq ($(HOSTARCH), x86_64)
ARCH3264 := -m32
- LIBDIR := $(PREFIX)/lib
endif
endif
ifeq ($(ARCH), x86_64)
CFLAGS += -mno-red-zone
+ LIBDIR := $(PREFIX)/lib64
ifeq ($(HOSTARCH), ia32)
ARCH3264 := -m64
- LIBDIR := $(PREFIX)/lib64
endif
endif
diff --git a/util/Makefile b/util/Makefile
index 1dd4ca0..1cf782c 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -3,11 +3,11 @@ TOPDIR = $(SRCDIR)/..
include $(TOPDIR)/Make.defaults
-FORMAT=efi-app-x86_64
-LDFLAGS = -nostdlib -T /usr/lib64/gnuefi/elf_x86_64_efi.lds -shared -Bsymbolic /usr/lib64/gnuefi/crt0-efi-x86_64.o -L/usr/lib64/
+FORMAT=efi-app-$(HOSTARCH)
+LDFLAGS = -nostdlib -T $(LIBDIR)/gnuefi/elf_$(HOSTARCH)_efi.lds -shared -Bsymbolic $(LIBDIR)/gnuefi/crt0-efi-$(HOSTARCH).o -L$(LIBDIR)
LIBS=-lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
CCLDFLAGS =
-CFLAGS = -I/usr/include/efi/ -I/usr/include/efi/x86_64/ -I/usr/include/efi/protocol -fpic -fshort-wchar -fno-reorder-functions -fno-strict-aliasing -fno-merge-constants -mno-red-zone -Wimplicit-function-declaration
+CFLAGS = -I/usr/include/efi/ -I/usr/include/efi/$(HOSTARCH)/ -I/usr/include/efi/protocol -fpic -fshort-wchar -fno-reorder-functions -fno-strict-aliasing -fno-merge-constants -mno-red-zone -Wimplicit-function-declaration
TARGETS = setupsb.efi dumpsb.efi clearpk.efi
--
1.7.10.2