mk: Fix debug build error on ARM ThunderX2 and neoverse N1 platform

When building spdk on ARM platform like thunderx2 with --enable-debug,
there are following error:

/tmp/ccOBb4AF.s: Assembler messages:
/tmp/ccOBb4AF.s:45: Error: selected processor does not support `casp x0,x1,x2,x3,[x4]'
/tmp/ccOBb4AF.s:77: Error: selected processor does not support `caspa x0,x1,x2,x3,[x4]'
/tmp/ccOBb4AF.s:109: Error: selected processor does not support `caspl x0,x1,x2,x3,[x4]'
/tmp/ccOBb4AF.s:141: Error: selected processor does not support `caspal x0,x1,x2,x3,[x4]'

The reason is that DPDK is built with -march=armv8.1-a or -march=armv8.2-a+lse which
have these instructions while SPDK is built with -march=armv8-a+crc which does not support
them. Change spdk build machine to native can fix this.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I759d4ce2c557ce5ff73a802d7a4b6579c4ba64f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7025
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
root 2021-03-19 15:38:55 +08:00 committed by Tomasz Zawadzki
parent 844d94b8a7
commit de8f3a50ee

View File

@ -86,11 +86,7 @@ COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-fie
ifneq ($(filter powerpc% ppc%,$(TARGET_MACHINE)),) ifneq ($(filter powerpc% ppc%,$(TARGET_MACHINE)),)
COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE) COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
else ifeq ($(TARGET_MACHINE),aarch64) else ifeq ($(TARGET_MACHINE),aarch64)
ifeq ($(TARGET_ARCHITECTURE),native)
COMMON_CFLAGS += -march=armv8-a+crc
else
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE) COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
endif
COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE) COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
else else
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE) COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)