Blame SOURCES/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch

e01d91
From 17c35d075f067d80fee112ae18365b8defa2ca5a Mon Sep 17 00:00:00 2001
e01d91
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
e01d91
Date: Fri, 19 Feb 2021 11:38:59 +0900
e01d91
Subject: [PATCH 2/2] Makefile: fix build failure on aarch64 and ppc64le
e01d91
e01d91
Currently, there is build failure on aarch64 and ppc64le as follows:
e01d91
e01d91
    gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -Wall -I/usr/include/crash -nostartfiles -shared -rdynamic -o trace.so trace.c -fPIC -D
e01d91
    gcc: error: macro name missing after '-D'
e01d91
e01d91
The failure is caused by missing arguments for -D option because
e01d91
TARGET variable is empty.
e01d91
e01d91
This commit fixes the issue by defining TARGET variable properly
e01d91
according to aarch64 and ppc64le.
e01d91
e01d91
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
e01d91
---
e01d91
 Makefile | 8 ++++++++
e01d91
 1 file changed, 8 insertions(+)
e01d91
e01d91
diff --git a/Makefile b/Makefile
e01d91
index b4573b4..0d35d4f 100755
e01d91
--- a/Makefile
e01d91
+++ b/Makefile
e01d91
@@ -6,6 +6,10 @@ ifeq ($(shell arch), ppc64)
e01d91
   TARGET=PPC64
e01d91
   TARGET_CFLAGS=-m64
e01d91
 endif
e01d91
+ifeq ($(shell arch), ppc64le)
e01d91
+  TARGET=PPC64
e01d91
+  TARGET_CFLAGS=-m64
e01d91
+endif
e01d91
 ifeq ($(shell arch), ia64)
e01d91
   TARGET=IA64
e01d91
   TARGET_CFLAGS=
e01d91
@@ -22,6 +26,10 @@ ifeq ($(shell arch), s390)
e01d91
   TARGET=S390
e01d91
   TARGET_CFLAGS=
e01d91
 endif
e01d91
+ifeq ($(shell arch), aarch64)
e01d91
+  TARGET=ARM64
e01d91
+  TARGET_CFLAGS=
e01d91
+endif
e01d91
 
e01d91
 INCDIR=/usr/include/crash
e01d91
 
e01d91
-- 
e01d91
2.29.2
e01d91