From 23fcaef6e97a15775db643210c9fda42fe8ab23d Mon Sep 17 00:00:00 2001 From: Simon Farre Date: Wed, 3 Jul 2024 17:11:46 +0200 Subject: [PATCH] Bug fix AVX512F support always returned true due to using -mavx512f as flag instead of -march=native to `try_compile` --- CMakeLists.txt | 2 +- src/ExtraRegisters.cc | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c471fe9510..601d39330ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,7 @@ if (SUPPORTS_MACRO_PREFIX_MAP) set(FLAGS_COMMON "${FLAGS_COMMON} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") endif() -try_compile(AVX512F_SUPPORT ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/test/gdb_avx512.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS=-mavx512f) +try_compile(AVX512F_SUPPORT ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/test/gdb_avx512.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS=-march=native) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS_COMMON} -Wstrict-prototypes -std=gnu11") # Define __STDC_LIMIT_MACROS so |#include | works as expected. diff --git a/src/ExtraRegisters.cc b/src/ExtraRegisters.cc index 36ecd2b7779..1efdd0a0a3b 100644 --- a/src/ExtraRegisters.cc +++ b/src/ExtraRegisters.cc @@ -77,9 +77,6 @@ static const uint64_t PKRU_FEATURE_MASK = 1 << PKRU_FEATURE_BIT; static const size_t xsave_header_offset = 512; static const size_t xsave_header_size = 64; static const size_t xsave_header_end = xsave_header_offset + xsave_header_size; -// This is always at 576 since AVX is always the first optional feature, -// if present. -static const size_t AVX_xsave_offset = 576; struct RegisterConfig { int8_t feature; GdbServerRegister base;