From: Kefu Chai Date: Thu, 27 Aug 2020 09:06:37 +0000 (+0800) Subject: cmake: use core2 when targeting amd64 X-Git-Tag: v16.1.0~1230^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e7a7e30763b53ce6f47bf055014ec5be93e9ab3;p=ceph.git cmake: use core2 when targeting amd64 instead of sticking to the building host's march (native), use a safer guess. Fixes: https://tracker.ceph.com/issues/24948 Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/BuildSPDK.cmake b/cmake/modules/BuildSPDK.cmake index 60575a7abaf9..05a6b2370067 100644 --- a/cmake/modules/BuildSPDK.cmake +++ b/cmake/modules/BuildSPDK.cmake @@ -19,10 +19,21 @@ macro(build_spdk) set(spdk_CFLAGS "${spdk_CFLAGS} -Wno-address-of-packed-member") endif() include(ExternalProject) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64") + # a safer option than relying on the build host's arch + set(target_arch core2) + else() + # default arch used by SPDK + set(target_arch native) + endif() ExternalProject_Add(spdk-ext DEPENDS dpdk-ext SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/spdk - CONFIGURE_COMMAND ./configure --with-dpdk=${DPDK_DIR} --without-isal --without-vhost + CONFIGURE_COMMAND ./configure + --with-dpdk=${DPDK_DIR} + --without-isal + --without-vhost + --target-arch=${target_arch} # unset $CFLAGS, otherwise it will interfere with how SPDK sets # its include directory. # unset $LDFLAGS, otherwise SPDK will fail to mock some functions.