You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pesign-test-app/0001-Fix-gnu-efi-include-pa...

53 lines
1.9 KiB

From ec7b1c7fa87d6e576cd6c5526748adf683f676ce Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 12 Nov 2019 14:50:34 -0500
Subject: [PATCH] Fix gnu-efi include path.
Signed-off-by: Peter Jones <rpm-build>
---
Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 93b1ffd7ac6..f5023de7a9f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,21 @@
VERSION = 5
ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
+ARCH_SUFFIX = $(shell uname -m | sed -e s,i[3456789]86,ia32, -e s,x86_64,x64, -e s,aarch64,aa64,)
DATADIR := /usr/share
LIBDIR := /usr/lib64
-GNUEFIDIR ?= $(LIBDIR)/gnuefi/
+GNUEFIDIR ?= $(LIBDIR)/gnuefi/
CC = gcc
CFLAGS ?= -O0 -g3
BUILDFLAGS := $(CFLAGS) -fpic -Werror -Wall -Wextra -fshort-wchar \
-fno-merge-constants -ffreestanding \
-fno-stack-protector -fno-stack-check --std=gnu11 -DCONFIG_$(ARCH) \
- -I/usr/include/efi/ -I/usr/include/efi/$(ARCH)/ \
+ -I/usr/include/efi/ -I/usr/include/efi/$(ARCH_SUFFIX)/ \
-I/usr/include/efi/protocol
CCLDFLAGS ?= -nostdlib -Wl,--warn-common \
-Wl,--no-undefined -Wl,--fatal-warnings \
- -Wl,-shared -Wl,-Bsymbolic -L$(LIBDIR) -L$(GNUEFIDIR) \
+ -Wl,-shared -Wl,-Bsymbolic -L$(LIBDIR) -L$(GNUEFIDIR)/$(ARCH_SUFFIX) \
-Wl,--build-id=sha1 -Wl,--hash-style=sysv \
- $(GNUEFIDIR)/crt0-efi-$(ARCH).o
+ $(GNUEFIDIR)/$(ARCH_SUFFIX)/crt0.o
LD = ld
OBJCOPY = objcopy
OBJCOPY_GTE224 = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.* //g' | cut -f1-2 -d.` \>= 2.24)
@@ -57,7 +58,7 @@ endif
%.so : %.o
$(CC) $(CCLDFLAGS) -o $@ $^ -lefi -lgnuefi \
$(shell $(CC) -print-libgcc-file-name) \
- -T $(GNUEFIDIR)/elf_$(ARCH)_efi.lds
+ -T $(GNUEFIDIR)/elf_$(ARCH_SUFFIX)_efi.lds
%.o : %.c
$(CC) $(BUILDFLAGS) -c -o $@ $^
--
2.23.0