未验证 提交 f565ff37 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

fix: get cpuid on x86 only (#18552)

* chore: taostools sanitizer flag align with tdengine

* chore: re-enable old style build asan config for taos-tools

* chore: update taos-tools 274d230

* chore: update taos-tools and add x86 definition

* fix: get cpu id on x86 only
上级 60b3d00a
......@@ -82,10 +82,12 @@ IF ("${CPUTYPE}" STREQUAL "")
MESSAGE(STATUS "Current platform is amd64")
SET(PLATFORM_ARCH_STR "amd64")
SET(TD_INTEL_64 TRUE)
ADD_DEFINITIONS("-D_TD_X86_")
ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)")
MESSAGE(STATUS "Current platform is x86")
SET(PLATFORM_ARCH_STR "i386")
SET(TD_INTEL_32 TRUE)
ADD_DEFINITIONS("-D_TD_X86_")
ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l")
MESSAGE(STATUS "Current platform is aarch32")
SET(PLATFORM_ARCH_STR "arm")
......
......@@ -2,7 +2,7 @@
# taos-tools
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG 9f587e9
GIT_TAG d19e82c
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
......
......@@ -48,8 +48,10 @@ extern "C" {
#else
#include <argp.h>
#include <sys/prctl.h>
#if defined(_TD_X86_)
#include <cpuid.h>
#endif
#endif
#else
#ifndef __func__
......
......@@ -481,6 +481,7 @@ int32_t taosGetCpuInstructions(char* sse42, char* avx, char* avx2, char* fma) {
#elif defined(_TD_DARWIN_64)
#else
#ifdef _TD_X86_
// Since the compiler is not support avx/avx2 instructions, the global variables always need to be
// set to be false
#if __AVX__ || __AVX2__
......@@ -504,6 +505,7 @@ int32_t taosGetCpuInstructions(char* sse42, char* avx, char* avx2, char* fma) {
// Ref to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77756
__cpuid_fix(7u, eax, ebx, ecx, edx);
*avx2 = (char) ((ebx & bit_AVX2) == bit_AVX2);
#endif // _TD_X86_
#endif
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册