-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blake3 hash implementation merge commit
This commit contains the blake3 implementation to be used for libfyaml. It is considerably faster than the base BLAKE3 implementation since it is fully accelerated and with configurable backends. Signed-off-by: Pantelis Antoniou <[email protected]>
- Loading branch information
Showing
28 changed files
with
16,447 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,21 @@ AC_INIT([libfyaml], | |
m4_esyscmd([build-aux/git-version-gen .tarball-version]), | ||
[[email protected]]) | ||
|
||
AC_CONFIG_AUX_DIR([build-aux]) | ||
|
||
AC_PATH_PROG([M4], [m4 gm4], [no]) | ||
if test "x$M4" = xno ; then | ||
AC_MSG_ERROR([m4 missing]) | ||
fi | ||
|
||
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") | ||
|
||
AC_CANONICAL_TARGET | ||
|
||
AC_CONFIG_SRCDIR([src/lib/fy-parse.c]) | ||
AC_CONFIG_HEADERS([config.h]) | ||
AC_CONFIG_MACRO_DIR([m4]) | ||
AC_CONFIG_AUX_DIR([build-aux]) | ||
AM_INIT_AUTOMAKE([foreign 1.8.5 -Wall subdir-objects ]) | ||
AM_INIT_AUTOMAKE([foreign 1.8.5 subdir-objects -Wno-portability]) | ||
|
||
m4_pattern_allow([^(AM_EXTRA_RECURSIVE_TARGETS|AM_PROG_AR)$])dnl | ||
|
||
|
@@ -73,6 +83,7 @@ m4_version_prereq(2.64, [AX_CHECK_ENABLE_DEBUG()], [true]) | |
AC_PROG_MKDIR_P | ||
AC_PROG_CC | ||
AM_PROG_CC_C_O | ||
AM_PROG_AS | ||
|
||
AC_PROG_GCC_TRADITIONAL | ||
AC_USE_SYSTEM_EXTENSIONS | ||
|
@@ -83,14 +94,15 @@ AC_PROG_CXX | |
AC_PROG_AWK | ||
AC_PROG_LN_S | ||
|
||
AX_PTHREAD | ||
AX_PTHREAD([], [AC_MSG_ERROR("Missing required pthread support")]) | ||
|
||
AC_PATH_PROG([M4], [m4 gm4], [no]) | ||
if test "x$M4" = xno ; then | ||
AC_MSG_ERROR([m4 missing]) | ||
# in some cases PTHREAD_LIBS is empty - force -lpthread */ | ||
if test "x$PTHREAD_LIBS" = "x"; then | ||
PTHREAD_LIBS="-lpthread" | ||
fi | ||
|
||
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") | ||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | ||
LIBS="$LIBS $PTHREAD_LIBS" | ||
|
||
# pkg-config | ||
PKG_PROG_PKG_CONFIG | ||
|
@@ -136,6 +148,58 @@ AC_SUBST(HAVE_STATIC) | |
AC_DEFINE_UNQUOTED([HAVE_STATIC], [$HAVE_STATIC], [Define to 1 if static linking is available]) | ||
AM_CONDITIONAL([HAVE_STATIC], [ test x$HAVE_STATIC = x1 ]) | ||
|
||
dnl Per target optimizations | ||
AC_ARG_ENABLE([portable-target], | ||
AS_HELP_STRING([--enable-portable-target], | ||
[Enable portable mode (disable per-target optimizations)])) | ||
HAVE_PORTABLE_TARGET=0 | ||
if test "x$enable_portable_target" == "xyes"; then | ||
HAVE_PORTABLE_TARGET=1 | ||
fi | ||
AC_SUBST(HAVE_PORTABLE_TARGET) | ||
AC_DEFINE_UNQUOTED([HAVE_PORTABLE_TARGET], [$HAVE_PORTABLE_TARGET], [Define to 1 if PORTABLE_TARGET is enabled]) | ||
AM_CONDITIONAL([HAVE_PORTABLE_TARGET], [ test x$HAVE_PORTABLE_TARGET == x1 ]) | ||
|
||
AM_CONDITIONAL([TARGET_CPU_X86], [ test x$target_cpu = xx86 ]) | ||
AM_CONDITIONAL([TARGET_CPU_X86_64], [ test x$target_cpu = xx86_64 ]) | ||
AM_CONDITIONAL([TARGET_CPU_ANY_X86], [ test x$target_cpu = xx86 -o x$target_cpu = xx86_64 ]) | ||
AM_CONDITIONAL([TARGET_CPU_ARM], [ test x$target_cpu = xarm ]) | ||
AM_CONDITIONAL([TARGET_CPU_ARM64], [ test x$target_cpu = xaarch64 ]) | ||
AM_CONDITIONAL([TARGET_CPU_ANY_ARM], [ test x$target_cpu = xarm -o x$target_cpu = xaarch64 ]) | ||
|
||
AM_COND_IF([TARGET_CPU_ANY_X86], [m4_version_prereq(2.64, [ | ||
AX_CHECK_COMPILE_FLAG([-msse2], , , [-Werror]) | ||
AX_CHECK_COMPILE_FLAG([-msse4.1], , , [-Werror]) | ||
AX_CHECK_COMPILE_FLAG([-mavx2], , , [-Werror]) | ||
AX_CHECK_COMPILE_FLAG([-mavx512f -mavx512vl], , , [-Werror]) | ||
], [true]) | ||
]) | ||
|
||
AM_COND_IF([TARGET_CPU_ARM], [m4_version_prereq(2.64, [ | ||
AX_CHECK_COMPILE_FLAG([-mfpu=neon], , , [-Werror]) | ||
], [true]) | ||
]) | ||
|
||
AM_CONDITIONAL([TARGET_HAS_SSE2], [ test "x$ax_cv_check_cflags__Werror__msse2" = x"yes" -a "x$enable_portable_target" != "xyes" ]) | ||
AM_CONDITIONAL([TARGET_HAS_SSE41], [ test "x$ax_cv_check_cflags__Werror__msse4_1" = x"yes" -a "x$enable_portable_target" != "xyes" ]) | ||
AM_CONDITIONAL([TARGET_HAS_AVX2], [ test "x$ax_cv_check_cflags__Werror__mavx2" = x"yes" -a "x$enable_portable_target" != "xyes" ]) | ||
AM_CONDITIONAL([TARGET_HAS_AVX512], [ test "x$ax_cv_check_cflags__Werror__mavx512f__mavx512vl" = x"yes" -a "x$enable_portable_target" != "xyes" ]) | ||
|
||
AM_CONDITIONAL([TARGET_HAS_NEON], [ test \( x$target_cpu = xaarch64 -o "x$ax_cv_check_cflags__Werror__mcpu_neon" = x"yes" \) -a "x$enable_portable_target" != "xyes" ]) | ||
|
||
AM_COND_IF([TARGET_HAS_SSE2], AC_DEFINE([TARGET_HAS_SSE2], [1], [SSE2 target support])) | ||
AM_COND_IF([TARGET_HAS_SSE41], AC_DEFINE([TARGET_HAS_SSE41], [1], [SSE41 target support])) | ||
AM_COND_IF([TARGET_HAS_AVX2], AC_DEFINE([TARGET_HAS_AVX2], [1], [AVX2 target support])) | ||
AM_COND_IF([TARGET_HAS_AVX512], AC_DEFINE([TARGET_HAS_AVX512], [1], [AVX512 target support])) | ||
|
||
AM_COND_IF([TARGET_HAS_NEON], AC_DEFINE([TARGET_HAS_NEON], [1], [NEON target support])) | ||
|
||
dnl check whether warning flags are support | ||
AX_CHECK_COMPILE_FLAG([-Wstringop-overread], , , [-Werror]) | ||
AS_IF([test "x$ax_cv_check_cflags__Werror__wstringop_overread" = x"yes"], | ||
[HAVE_WSTRINGOP_OVERREAD=1], [HAVE_WSTRINGOP_OVERREAD=0]) | ||
AC_DEFINE_UNQUOTED([HAVE_WSTRINGOP_OVERREAD], [$HAVE_WSTRINGOP_OVERREAD], [Define to 1 if -Wstringop-overread is supported]) | ||
|
||
dnl ASAN enable switch | ||
AC_ARG_ENABLE([asan], | ||
AS_HELP_STRING([--enable-asan], | ||
|
@@ -167,9 +231,6 @@ AM_CONDITIONAL([HAVE_ASAN], | |
[ test x$HAVE_ASAN = x1 ]) | ||
AC_DEFINE_UNQUOTED([HAVE_ASAN], [$HAVE_ASAN], [Define to 1 if ASAN is enabled]) | ||
|
||
# include -lm in the link | ||
AC_SEARCH_LIBS([llrintf], [m], [], [AC_MSG_ERROR([unable to find the llrintf() function])]) | ||
|
||
# check if there's a qsort_r available (musl does not have it) | ||
AC_CHECK_FUNC([qsort_r], | ||
HAVE_QSORT_R=1, | ||
|
@@ -505,5 +566,4 @@ echo " | |
TESTSUITECHECKOUT: $TESTSUITECHECKOUT | ||
JSONTESTSUITEURL: $JSONTESTSUITEURL | ||
JSONTESTSUITECHECKOUT: $JSONTESTSUITECHECKOUT | ||
|
||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.