[sleef] Avoid MSVC 19.51 compiler ICE. (#51813)

This commit is contained in:
Billy O'Neal 2026-05-16 01:55:55 -07:00 committed by GitHub
parent 35a62dd32a
commit dc42dfdad5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 35 additions and 15 deletions

View File

@ -1,8 +1,8 @@
diff --git a/Configure.cmake b/Configure.cmake
index c7b5023..178ea44 100644
index e23f577..23225ab 100644
--- a/Configure.cmake
+++ b/Configure.cmake
@@ -253,6 +253,9 @@ set(CLANG_FLAGS_ENABLE_AVX2128 "-mavx2;-mfma")
@@ -247,6 +247,9 @@ set(CLANG_FLAGS_ENABLE_AVX2128 "-mavx2;-mfma")
set(CLANG_FLAGS_ENABLE_AVX512F "-mavx512f")
set(CLANG_FLAGS_ENABLE_AVX512FNOFMA "-mavx512f")
set(CLANG_FLAGS_ENABLE_NEON32 "--target=arm-linux-gnueabihf;-mcpu=cortex-a8")
@ -13,7 +13,7 @@ index c7b5023..178ea44 100644
# Arm AArch64 vector extensions.
set(CLANG_FLAGS_ENABLE_SVE "-march=armv8-a+sve")
diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt
index 526c4f8..d57c3b8 100644
index 15bee24..57a4a80 100644
--- a/src/dft/CMakeLists.txt
+++ b/src/dft/CMakeLists.txt
@@ -173,7 +173,9 @@ if (COMPILER_SUPPORTS_SVE)

View File

@ -0,0 +1,14 @@
diff --git a/Configure.cmake b/Configure.cmake
index 178ea44..ef5676c 100644
--- a/Configure.cmake
+++ b/Configure.cmake
@@ -877,6 +877,9 @@ endif()
# Built-in math functions
CHECK_C_SOURCE_COMPILES("
+ #if defined(_MSC_VER) && _MSC_VER == 1951
+ #error Not supported, avoid a compiler crash
+ #endif
int main(void) {
double a = __builtin_sqrt (2);
float b = __builtin_sqrtf(2);

View File

@ -1,5 +1,5 @@
diff --git a/Configure.cmake b/Configure.cmake
index e23f577..c7b5023 100644
index 23225ab..178ea44 100644
--- a/Configure.cmake
+++ b/Configure.cmake
@@ -55,9 +55,15 @@ endif()
@ -29,10 +29,10 @@ index 6e423f2..4d415ab 100644
+endif()
include("${CMAKE_CURRENT_LIST_DIR}/sleefTargets.cmake")
diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt
index 15bee24..526c4f8 100644
index 57a4a80..d57c3b8 100644
--- a/src/dft/CMakeLists.txt
+++ b/src/dft/CMakeLists.txt
@@ -216,8 +216,8 @@ endif()
@@ -218,8 +218,8 @@ endif()
# Compiler properties
@ -43,7 +43,7 @@ index 15bee24..526c4f8 100644
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
@@ -414,7 +414,7 @@ endforeach()
@@ -416,7 +416,7 @@ endforeach()
# Target libdft
add_library(${TARGET_LIBDFT} $<TARGET_OBJECTS:dftcommon_obj> $<TARGET_OBJECTS:dft_obj> ${UNROLL_OBJECTS})

View File

@ -10,6 +10,7 @@ vcpkg_from_github(
export-link-libs.diff
sleefdft.pc.diff
seh-cpu-ext.diff
disable-msvc-builtin-math.diff # avoids an MSVC 19.51 ICE
)
vcpkg_check_features(OUT_FEATURE_OPTIONS options
@ -56,4 +57,3 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

View File

@ -1,8 +1,8 @@
diff --git a/src/libm/dispatcher.h b/src/libm/dispatcher.h
index 41b69d9..4d395c3 100644
index f9de604..ccbc786 100644
--- a/src/libm/dispatcher.h
+++ b/src/libm/dispatcher.h
@@ -27,6 +27,14 @@ NOEXPORT int Sleef_internal_cpuSupportsExt(void (*tryExt)(), int *cache) {
@@ -27,6 +27,14 @@ static int cpuSupportsExt(void (*tryExt)()) {
static int cache = -1;
if (cache != -1) return cache;
@ -17,10 +17,11 @@ index 41b69d9..4d395c3 100644
void (*org);
org = signal(SIGILL, sighandler);
@@ -38,5 +46,6 @@ NOEXPORT int Sleef_internal_cpuSupportsExt(void (*tryExt)(), int *cache) {
@@ -38,6 +46,7 @@ static int cpuSupportsExt(void (*tryExt)()) {
}
signal(SIGILL, org);
+#endif
return cache;
}

View File

@ -1,8 +1,8 @@
diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt
index 526c4f8..667a7c2 100644
index d57c3b8..d404273 100644
--- a/src/dft/CMakeLists.txt
+++ b/src/dft/CMakeLists.txt
@@ -443,3 +443,22 @@ install(
@@ -445,3 +445,22 @@ install(
INCLUDES #
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

View File

@ -1,7 +1,7 @@
{
"name": "sleef",
"version": "3.9.0",
"port-version": 1,
"port-version": 2,
"description": "SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT",
"homepage": "https://sleef.org/",
"license": "BSL-1.0",

View File

@ -9330,7 +9330,7 @@
},
"sleef": {
"baseline": "3.9.0",
"port-version": 1
"port-version": 2
},
"sleepy-discord": {
"baseline": "2025-12-18",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "72cd34312d2d114eb4dcdf9b9e30ab4e8117cca5",
"version": "3.9.0",
"port-version": 2
},
{
"git-tree": "c20095f0ab0040ddf9f28377e35d670fbc720daa",
"version": "3.9.0",