pesign/0005-fcf-protection-is-arch...

45 lines
1.4 KiB
Diff

From d4fb4e0bfe43a3a3ca454ef6297f75962582b464 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Wed, 9 Feb 2022 15:23:27 -0500
Subject: [PATCH] -fcf-protection is arch-specific
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
Make.defaults | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Make.defaults b/Make.defaults
index fdb961a..7c320b5 100644
--- a/Make.defaults
+++ b/Make.defaults
@@ -22,11 +22,15 @@ EFI_ARCHES ?= aa64 ia32 x64
enabled = $(if $(filter undefined,$(origin $(1))),$(3),$(2))
+HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
+ARCH := $(shell uname -m | sed s,i[3456789]86,ia32,)
+
+
PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
CC := $(if $(filter default,$(origin CC)),$(CROSS_COMPILE)gcc,$(CC))
CCLD := $(if $(filter undefined,$(origin CCLD)),$(CC),$(CCLD))
CFLAGS ?= -O2 -g3 -pipe -fPIE -fstack-protector-all \
- -fstack-clash-protection -fcf-protection=full
+ -fstack-clash-protection $(ifneq(($ARCH), aa64),-fcf-protection=full,)
DIAGFLAGS ?= -fmessage-length=0 \
-fdiagnostics-color=always \
-fdiagnostics-format=text \
@@ -42,9 +46,6 @@ INSTALL ?= $(CROSS_COMPILE)install
PKGS = efivar nspr nss nss-util uuid
-HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH := $(shell uname -m | sed s,i[3456789]86,ia32,)
-
SOFLAGS ?= -shared
clang_cflags =
gcc_cflags = -Wmaybe-uninitialized -grecord-gcc-switches \
--
2.34.1