reenable sse/avx2 fastutf8 in rspamd. there actually is a check and the way

it was disabled was causing missing functions that are needed in some cases.
This commit is contained in:
sthen 2019-12-29 21:35:02 +00:00
parent 191ef5c451
commit d6d7a47903
2 changed files with 2 additions and 34 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.77 2019/12/29 20:54:53 sthen Exp $
# $OpenBSD: Makefile,v 1.78 2019/12/29 21:35:02 sthen Exp $
COMMENT= event-driven spam filtering system in C/Lua
GH_ACCOUNT= vstakhov
GH_PROJECT= rspamd
GH_TAGNAME= 2.2
REVISION= 0
REVISION= 1
CATEGORIES= mail

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-contrib_fastutf8_CMakeLists_txt,v 1.1 2019/12/23 13:25:48 sthen Exp $
(checked in rspamd-2.2), fastutf8 doesn't do runtime cpuid checks for
avx2/sse4.1 so they are forcibly disabled here otherwise packages built
on more capable CPUs won't run on older machines.
(cryptobox also uses avx2 and various SSE but in that case there are
runtime checks).
Index: contrib/fastutf8/CMakeLists.txt
--- contrib/fastutf8/CMakeLists.txt.orig
+++ contrib/fastutf8/CMakeLists.txt
@@ -1,11 +1,19 @@
SET(UTFSRC ${CMAKE_CURRENT_SOURCE_DIR}/fastutf8.c)
IF(HAVE_AVX2)
+ IF(OPENBSD_BUILD)
+ MESSAGE(STATUS "UTF8: AVX2 detected but disabled for packages")
+ ELSE(OPENBSD_BUILD)
SET(UTFSRC ${UTFSRC} ${CMAKE_CURRENT_SOURCE_DIR}/avx2.c)
MESSAGE(STATUS "UTF8: AVX2 support is added")
+ ENDIF()
ENDIF()
IF(HAVE_SSE41)
+ IF(OPENBSD_BUILD)
+ MESSAGE(STATUS "UTF8: SSE41 detected but disabled for packages")
+ ELSE(OPENBSD_BUILD)
SET(UTFSRC ${UTFSRC} ${CMAKE_CURRENT_SOURCE_DIR}/sse41.c)
MESSAGE(STATUS "UTF8: SSE41 support is added")
+ ENDIF()
ENDIF()
CONFIGURE_FILE(platform_config.h.in platform_config.h)