diff --git a/cmake/arch.cmake b/cmake/arch.cmake index 8f772d3cdcf..f8e18629b09 100644 --- a/cmake/arch.cmake +++ b/cmake/arch.cmake @@ -26,7 +26,7 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif () if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64le.*|PPC64LE.*)") - set (PPC64LE 1) + set (ARCH_PPC64LE 1) if (COMPILER_CLANG OR (COMPILER_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)) message(FATAL_ERROR "Only gcc-8 is supported for powerpc architecture") endif () diff --git a/cmake/test_cpu.cmake b/cmake/test_cpu.cmake index 5b95ac5d25a..42f9bac936e 100644 --- a/cmake/test_cpu.cmake +++ b/cmake/test_cpu.cmake @@ -27,7 +27,7 @@ if (HAVE_SSE41) set (COMPILER_FLAGS "${COMPILER_FLAGS} ${TEST_FLAG}") endif () -if (PPC64LE) +if (ARCH_PPC64LE) set (COMPILER_FLAGS "${COMPILER_FLAGS} -maltivec -D__SSE2__=1 -DNO_WARN_X86_INTRINSICS") endif () diff --git a/contrib/libdivide/libdivide.h b/contrib/libdivide/libdivide.h index 1404295f814..eaeaec7db6b 100644 --- a/contrib/libdivide/libdivide.h +++ b/contrib/libdivide/libdivide.h @@ -342,7 +342,7 @@ static inline __m128i libdivide_get_0000FFFF(void) { #endif /// This is a bug in gcc-8, _MM_SHUFFLE was forgotten, though in trunk it is ok https://github.com/gcc-mirror/gcc/blob/master/gcc/config/rs6000/xmmintrin.h#L61 -#if __PPC__ +#if defined(__PPC__) #ifndef _MM_SHUFFLE #define _MM_SHUFFLE(w,x,y,z) (((w) << 6) | ((x) << 4) | ((y) << 2) | (z)) #endif diff --git a/contrib/libhdfs3-cmake/CMake/Options.cmake b/contrib/libhdfs3-cmake/CMake/Options.cmake index c35eac3c08d..d7ccc8b6475 100644 --- a/contrib/libhdfs3-cmake/CMake/Options.cmake +++ b/contrib/libhdfs3-cmake/CMake/Options.cmake @@ -7,9 +7,9 @@ CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") -IF(ENABLE_SSE STREQUAL ON AND NOT PPC64LE AND NOT ARCH_AARCH64 AND NOT ARCH_ARM) +IF(ENABLE_SSE STREQUAL ON AND NOT ARCH_PPC64LE AND NOT ARCH_AARCH64 AND NOT ARCH_ARM) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") -ENDIF(ENABLE_SSE STREQUAL ON) +ENDIF(ENABLE_SSE STREQUAL ON AND NOT ARCH_PPC64LE AND NOT ARCH_AARCH64 AND NOT ARCH_ARM) IF(NOT TEST_HDFS_PREFIX) SET(TEST_HDFS_PREFIX "./" CACHE STRING "default directory prefix used for test." FORCE) diff --git a/contrib/libunwind/CMakeLists.txt b/contrib/libunwind/CMakeLists.txt index 22470069938..80bd8a301f0 100644 --- a/contrib/libunwind/CMakeLists.txt +++ b/contrib/libunwind/CMakeLists.txt @@ -1,6 +1,6 @@ enable_language(ASM) -if (PPC64LE) +if (ARCH_PPC64LE) add_library(unwind src/mi/init.c src/mi/flush_cache.c diff --git a/dbms/src/IO/parseDateTimeBestEffort.cpp b/dbms/src/IO/parseDateTimeBestEffort.cpp index f17c3fc61a8..11208424c62 100644 --- a/dbms/src/IO/parseDateTimeBestEffort.cpp +++ b/dbms/src/IO/parseDateTimeBestEffort.cpp @@ -44,7 +44,7 @@ inline size_t readAlpha(char * res, size_t max_chars, ReadBuffer & in) return num_chars; } -#if __PPC__ +#if defined(__PPC__) #if !__clang__ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif @@ -519,7 +519,7 @@ ReturnType parseDateTimeBestEffortImpl(time_t & res, ReadBuffer & in, const Date } -#if __PPC__ +#if defined(__PPC__) #if !__clang__ #pragma GCC diagnostic pop #endif diff --git a/libs/libcommon/cmake/find_jemalloc.cmake b/libs/libcommon/cmake/find_jemalloc.cmake index c611dfc541a..3a1b14d9c33 100644 --- a/libs/libcommon/cmake/find_jemalloc.cmake +++ b/libs/libcommon/cmake/find_jemalloc.cmake @@ -1,4 +1,4 @@ -if (OS_LINUX AND NOT SANITIZE AND NOT ARCH_ARM AND NOT ARCH_32 AND NOT PPC64LE) +if (OS_LINUX AND NOT SANITIZE AND NOT ARCH_ARM AND NOT ARCH_32 AND NOT ARCH_PPC64LE) set(ENABLE_JEMALLOC_DEFAULT 1) else () set(ENABLE_JEMALLOC_DEFAULT 0) diff --git a/libs/libcommon/include/common/DateLUTImpl.h b/libs/libcommon/include/common/DateLUTImpl.h index c529d0938b5..936efa31ae4 100644 --- a/libs/libcommon/include/common/DateLUTImpl.h +++ b/libs/libcommon/include/common/DateLUTImpl.h @@ -14,7 +14,7 @@ #define DATE_LUT_MAX_YEAR 2105 /// Last supported year #define DATE_LUT_YEARS (1 + DATE_LUT_MAX_YEAR - DATE_LUT_MIN_YEAR) /// Number of years in lookup table -#if __PPC__ +#if defined(__PPC__) #if !__clang__ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif @@ -690,7 +690,7 @@ public: } }; -#if __PPC__ +#if defined(__PPC__) #if !__clang__ #pragma GCC diagnostic pop #endif