]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: use core2 when targeting amd64
authorKefu Chai <kchai@redhat.com>
Thu, 27 Aug 2020 09:06:37 +0000 (17:06 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 27 Aug 2020 12:08:03 +0000 (20:08 +0800)
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 <kchai@redhat.com>
cmake/modules/BuildSPDK.cmake

index 60575a7abaf9088103ddb04b20a987cf6b07db91..05a6b237006769d68f20c8bf47c6b788133c9cc2 100644 (file)
@@ -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.