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

9957f3
From 17c35d075f067d80fee112ae18365b8defa2ca5a Mon Sep 17 00:00:00 2001
9957f3
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
9957f3
Date: Fri, 19 Feb 2021 11:38:59 +0900
9957f3
Subject: [PATCH 2/2] Makefile: fix build failure on aarch64 and ppc64le
9957f3
9957f3
Currently, there is build failure on aarch64 and ppc64le as follows:
9957f3
9957f3
    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
9957f3
    gcc: error: macro name missing after '-D'
9957f3
9957f3
The failure is caused by missing arguments for -D option because
9957f3
TARGET variable is empty.
9957f3
9957f3
This commit fixes the issue by defining TARGET variable properly
9957f3
according to aarch64 and ppc64le.
9957f3
9957f3
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
9957f3
---
9957f3
 Makefile | 8 ++++++++
9957f3
 1 file changed, 8 insertions(+)
9957f3
9957f3
diff --git a/Makefile b/Makefile
9957f3
index b4573b4..0d35d4f 100755
9957f3
--- a/Makefile
9957f3
+++ b/Makefile
9957f3
@@ -6,6 +6,10 @@ ifeq ($(shell arch), ppc64)
9957f3
   TARGET=PPC64
9957f3
   TARGET_CFLAGS=-m64
9957f3
 endif
9957f3
+ifeq ($(shell arch), ppc64le)
9957f3
+  TARGET=PPC64
9957f3
+  TARGET_CFLAGS=-m64
9957f3
+endif
9957f3
 ifeq ($(shell arch), ia64)
9957f3
   TARGET=IA64
9957f3
   TARGET_CFLAGS=
9957f3
@@ -22,6 +26,10 @@ ifeq ($(shell arch), s390)
9957f3
   TARGET=S390
9957f3
   TARGET_CFLAGS=
9957f3
 endif
9957f3
+ifeq ($(shell arch), aarch64)
9957f3
+  TARGET=ARM64
9957f3
+  TARGET_CFLAGS=
9957f3
+endif
9957f3
 
9957f3
 INCDIR=/usr/include/crash
9957f3
 
9957f3
-- 
9957f3
2.29.2
9957f3