From 36ab17515940d287dafa7fce81465e873186e684 Mon Sep 17 00:00:00 2001 From: HATAYAMA Daisuke Date: Fri, 19 Feb 2021 16:43:00 +0900 Subject: [PATCH] Makefile: fix build failure on aarch64 and ppc64le commit 17c35d075f067d80fee112ae18365b8defa2ca5a (HEAD -> devel, origin/devel) Author: HATAYAMA Daisuke Date: Fri Feb 19 11:38:59 2021 +0900 Makefile: fix build failure on aarch64 and ppc64le Currently, there is build failure on aarch64 and ppc64le as follows: 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 gcc: error: macro name missing after '-D' The failure is caused by missing arguments for -D option because TARGET variable is empty. This commit fixes the issue by defining TARGET variable properly according to aarch64 and ppc64le. Signed-off-by: HATAYAMA Daisuke Signed-off-by: HATAYAMA Daisuke --- ...build-failure-on-aarch64-and-ppc64le.patch | 50 +++++++++++++++++++ crash-trace-command.spec | 1 + 2 files changed, 51 insertions(+) create mode 100644 0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch diff --git a/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch b/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch new file mode 100644 index 0000000..14d4767 --- /dev/null +++ b/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch @@ -0,0 +1,50 @@ +From 17c35d075f067d80fee112ae18365b8defa2ca5a Mon Sep 17 00:00:00 2001 +From: HATAYAMA Daisuke +Date: Fri, 19 Feb 2021 11:38:59 +0900 +Subject: [PATCH 2/2] Makefile: fix build failure on aarch64 and ppc64le + +Currently, there is build failure on aarch64 and ppc64le as follows: + + 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 + gcc: error: macro name missing after '-D' + +The failure is caused by missing arguments for -D option because +TARGET variable is empty. + +This commit fixes the issue by defining TARGET variable properly +according to aarch64 and ppc64le. + +Signed-off-by: HATAYAMA Daisuke +--- + Makefile | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/Makefile b/Makefile +index b4573b4..0d35d4f 100755 +--- a/Makefile ++++ b/Makefile +@@ -6,6 +6,10 @@ ifeq ($(shell arch), ppc64) + TARGET=PPC64 + TARGET_CFLAGS=-m64 + endif ++ifeq ($(shell arch), ppc64le) ++ TARGET=PPC64 ++ TARGET_CFLAGS=-m64 ++endif + ifeq ($(shell arch), ia64) + TARGET=IA64 + TARGET_CFLAGS= +@@ -22,6 +26,10 @@ ifeq ($(shell arch), s390) + TARGET=S390 + TARGET_CFLAGS= + endif ++ifeq ($(shell arch), aarch64) ++ TARGET=ARM64 ++ TARGET_CFLAGS= ++endif + + INCDIR=/usr/include/crash + +-- +2.29.2 + diff --git a/crash-trace-command.spec b/crash-trace-command.spec index df9d1e9..64c0306 100644 --- a/crash-trace-command.spec +++ b/crash-trace-command.spec @@ -15,6 +15,7 @@ Requires: trace-cmd Requires: crash >= 7.2.0-2 Patch0001: 0001-Makefile-set-DT_SONAME-to-trace.so.patch +Patch0002: 0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch %description Command for reading ftrace data from a dump file.