Skip to content

Commit

Permalink
cmake: use core2 when targeting amd64
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tchaikov committed Aug 27, 2020
1 parent 8b1c06d commit 8e7a7e3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmake/modules/BuildSPDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8e7a7e3

Please sign in to comment.