option (ENABLE_HYPERSCAN "Enable hyperscan for fast regexp processing [default: OFF]" OFF)
if (ENABLE_HYPERSCAN MATCHES "ON")
- if (NOT ("${ARCH}" STREQUAL "x86_64" OR "${ARCH}" STREQUAL "i386"))
- MESSAGE(FATAL_ERROR "Hyperscan is supported only on x86_64/i386 architectures")
- endif ()
ProcessPackage (HYPERSCAN LIBRARY hs INCLUDE hs.h INCLUDE_SUFFIXES
hs include/hs
ROOT ${HYPERSCAN_ROOT_DIR} MODULES libhs)
set (USE_CXX_LINKER 1)
endif ()
endif ()
-endif ()
\ No newline at end of file
+endif ()
rspamd_rs_compile (struct hs_helper_ctx *ctx, struct rspamd_worker *worker,
gboolean forced)
{
+#ifndef __aarch64__
if (!(ctx->cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
msg_warn ("CPU doesn't have SSSE3 instructions set "
"required for hyperscan, disable hyperscan compilation");
return FALSE;
}
+#endif
if (!rspamd_hs_helper_cleanup_dir (ctx, forced)) {
msg_warn ("cannot cleanup cache dir '%s'", ctx->hs_dir);
rspamd_regexp_library_init (cfg);
rspamd_multipattern_library_init (cfg->hs_cache_dir);
-#ifdef WITH_HYPERSCAN
+#if defined(WITH_HYPERSCAN) && !defined(__aarch64__)
if (!cfg->disable_hyperscan) {
if (!(cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
msg_warn_config ("CPU doesn't have SSSE3 instructions set "
map = re_map->map;
+#ifndef __aarch64__
if (!(map->cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
msg_info_map ("disable hyperscan for map %s, ssse3 instructons are not supported by CPU",
map->name);
return;
}
+#endif
if (hs_populate_platform (&plt) != HS_SUCCESS) {
msg_err_map ("cannot populate hyperscan platform");
}
return NULL;
-}
\ No newline at end of file
+}