From: Michael Jeanson Date: Wed, 2 Dec 2020 17:31:46 +0000 (+0000) Subject: fix: reorder x86 arch detection X-Git-Tag: v0.13.0~48 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c966839e39761d1dcf9fc17450630fdb317ec156;p=userspace-rcu.git fix: reorder x86 arch detection Reorder the detection code from most specific to most generic as defines for i386 can be present even when building for i686. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I81531b05318a0eaa9984075311828d87be7d46fc --- diff --git a/include/urcu/arch.h b/include/urcu/arch.h index fdbec3d..c4b8bc2 100644 --- a/include/urcu/arch.h +++ b/include/urcu/arch.h @@ -49,39 +49,40 @@ * URCU_ARCH_M68K : All Motorola 68000 variants * URCU_ARCH_RISCV : All RISC-V variants */ -#if (defined(__i386__) || defined(__i386)) + +#if (defined(__INTEL_OFFLOAD) || defined(__TARGET_ARCH_MIC) || defined(__MIC__)) #define URCU_ARCH_X86 1 -#define URCU_ARCH_I386 1 +#define URCU_ARCH_AMD64 1 +#define URCU_ARCH_K1OM 1 #include -#elif (defined(__i486__) || defined(__i586__) || defined(__i686__)) +#elif (defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)) #define URCU_ARCH_X86 1 +#define URCU_ARCH_AMD64 1 #include -#elif (defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)) +#elif (defined(__i486__) || defined(__i586__) || defined(__i686__)) #define URCU_ARCH_X86 1 -#define URCU_ARCH_AMD64 1 #include -#elif (defined(__INTEL_OFFLOAD) || defined(__TARGET_ARCH_MIC) || defined(__MIC__)) +#elif (defined(__i386__) || defined(__i386)) #define URCU_ARCH_X86 1 -#define URCU_ARCH_AMD64 1 -#define URCU_ARCH_K1OM 1 +#define URCU_ARCH_I386 1 #include -#elif (defined(__powerpc__) || defined(__powerpc) || defined(__ppc__)) +#elif (defined(__powerpc64__) || defined(__ppc64__)) #define URCU_ARCH_PPC 1 +#define URCU_ARCH_PPC64 1 #include -#elif (defined(__powerpc64__) || defined(__ppc64__)) +#elif (defined(__powerpc__) || defined(__powerpc) || defined(__ppc__)) #define URCU_ARCH_PPC 1 -#define URCU_ARCH_PPC64 1 #include #elif (defined(__s390__) || defined(__s390x__) || defined(__zarch__))