Commit d40944a2 authored by Richael Zhuang's avatar Richael Zhuang Committed by Jim Harris
Browse files

util: Solve "invalid target attribute" building error



When building SPDK on aarch64, met error about invalid target attribute 'bmi',
'arch=core2' and 'arch=atom'.

Signed-off-by: default avatarRichael Zhuang <richael.zhuang@arm.com>
Change-Id: I369e61005e6550045e24d84147a71b5dd25c4a52
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466848


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent be04cfc3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ extern "C" {
/* The following will automatically generate several version of
 * this function, targeted at different architectures. This
 * is only supported by GCC 6 or newer. */
#if defined(__GNUC__) && __GNUC__ >= 6 && !defined(__clang__)
#if defined(__GNUC__) && __GNUC__ >= 6 && !defined(__clang__) \
	&& (defined(__i386__) || defined(__x86_64__))
__attribute__((target_clones("bmi", "arch=core2", "arch=atom", "default")))
#endif
static inline uint32_t
@@ -82,7 +83,8 @@ spdk_align32pow2(uint32_t x)
/* The following will automatically generate several version of
 * this function, targeted at different architectures. This
 * is only supported by GCC 6 or newer. */
#if defined(__GNUC__) && __GNUC__ >= 6 && !defined(__clang__)
#if defined(__GNUC__) && __GNUC__ >= 6 && !defined(__clang__) \
	&& (defined(__i386__) || defined(__x86_64__))
__attribute__((target_clones("bmi", "arch=core2", "arch=atom", "default")))
#endif
static inline uint64_t