Skip to content

Commit

Permalink
Merge #17398: build: Update leveldb to 1.22+
Browse files Browse the repository at this point in the history
677fb8e test: Add ubsan surpression for crc32c (Wladimir J. van der Laan)
8e68bb1 build: Disable msvc warning 4722 for leveldb build (Aaron Clauson)
be23949 build: MSVC changes for leveldb update (Aaron Clauson)
9ebdf04 build: CRC32C build system integration (Wladimir J. van der Laan)
402252a build: Add LCOV exception for crc32c (Wladimir J. van der Laan)
3a037d0 test: Add crc32c exception to various linters and generation scripts (Wladimir J. van der Laan)
84ff1b2 test: Add crc32c to subtree check linter (Wladimir J. van der Laan)
7cf13a5 doc: Add crc32c subtree to developer notes (Wladimir J. van der Laan)
24d02a9 build: Update build system for new leveldb (Wladimir J. van der Laan)
2e18193 Squashed 'src/crc32c/' content from commit 224988680f7673cd7c769963d4035cb315aa3388 (Wladimir J. van der Laan)
6648082 Squashed 'src/leveldb/' changes from f545dfa..f8ae182c1e5176d12e816fb2217ae33a5472fdd7 (Wladimir J. van der Laan)

Pull request description:

  This updates leveldb to currently newest upstream commit bitcoin-core/leveldb-subtree@0c40829:

  - CRC32C hardware acceleration is now an external library [crc32c](https://github.com/google/crc32c). This adds acceleration on ARM, and should be faster on x86 because of using prefetch. It also makes it easy to support similar instruction sets on other platforms in the future.
  - Thread handling uses C++11, instead of platform specific code.
  - Native windows environment was added. No need to maintain our own hacky one, anymore.
  - Upstream now builds using CMake. This doesn't mean we need to use that (phew), but internal configuration changed to a a series of checks, instead of OS profiles. This means the blanket error "Cannot build leveldb for $host. Please file a bug report' is removed.

  All changes: google/leveldb@a53934a...0c40829

  Pretty much all our changes have been subsumed by upstream, so we figured it was cleaner to start over with a new branch from upstream with the still-relevant patches applied: https://github.com/bitcoin-core/leveldb/tree/bitcoin-fork-new

  There's quite some testing to be done (see below). See bitcoin-core/leveldb-subtree#25 and bitcoin-core/leveldb-subtree#26 for more history and context.

  TODO:
  - [x] Subtree `crc32c`
  - [x] Make linters happy about crc32 subtree
  - [x] Integrate `crc32c` library into build system
  - [x] MSVC build system

ACKs for top commit:
  sipa:
    ACK 677fb8e

Tree-SHA512: 37ee92a750e053e924bc4626b12bb3fd81faa9f8c5ebaa343931fee810c45ba05aa6051fdea82535fa351bf2be7297801b98af9469865fc5ead771650a5d6240
  • Loading branch information
laanwj committed Feb 10, 2020
2 parents 75fb37c + 677fb8e commit 22d1118
Show file tree
Hide file tree
Showing 212 changed files with 11,520 additions and 7,937 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ LCOV_FILTER_PATTERN = \
-p "/usr/lib/" \
-p "/usr/lib64/" \
-p "src/leveldb/" \
-p "src/crc32c/" \
-p "src/bench/" \
-p "src/univalue" \
-p "src/crypto/ctaes" \
Expand Down
14 changes: 6 additions & 8 deletions build_msvc/libleveldb/libleveldb.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<ClCompile Include="..\..\src\leveldb\db\version_set.cc" />
<ClCompile Include="..\..\src\leveldb\db\write_batch.cc" />
<ClCompile Include="..\..\src\leveldb\helpers\memenv\memenv.cc" />
<ClCompile Include="..\..\src\leveldb\port\port_posix_sse.cc" />
<ClCompile Include="..\..\src\leveldb\port\port_win.cc" />
<ClCompile Include="..\..\src\leveldb\table\block.cc" />
<ClCompile Include="..\..\src\leveldb\table\block_builder.cc" />
<ClCompile Include="..\..\src\leveldb\table\filter_block.cc" />
Expand All @@ -42,7 +40,7 @@
<ClCompile Include="..\..\src\leveldb\util\comparator.cc" />
<ClCompile Include="..\..\src\leveldb\util\crc32c.cc" />
<ClCompile Include="..\..\src\leveldb\util\env.cc" />
<ClCompile Include="..\..\src\leveldb\util\env_win.cc" />
<ClCompile Include="..\..\src\leveldb\util\env_windows.cc" />
<ClCompile Include="..\..\src\leveldb\util\filter_policy.cc" />
<ClCompile Include="..\..\src\leveldb\util\hash.cc" />
<ClCompile Include="..\..\src\leveldb\util\histogram.cc" />
Expand All @@ -51,11 +49,11 @@
<ClCompile Include="..\..\src\leveldb\util\status.cc" />
</ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;LEVELDB_PLATFORM_WINDOWS;LEVELDB_ATOMIC_PRESENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4267;4312;</DisableSpecificWarnings>
<AdditionalIncludeDirectories>..\..\src\leveldb;..\..\src\leveldb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile>
<PreprocessorDefinitions>HAVE_CRC32C=0;HAVE_SNAPPY=0;__STDC_LIMIT_MACROS;LEVELDB_IS_BIG_ENDIAN=0;_UNICODE;UNICODE;_CRT_NONSTDC_NO_DEPRECATE;LEVELDB_PLATFORM_WINDOWS;LEVELDB_ATOMIC_PRESENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4267;4312;4722;</DisableSpecificWarnings>
<AdditionalIncludeDirectories>..\..\src\leveldb;..\..\src\leveldb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
1 change: 1 addition & 0 deletions ci/lint/06_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test/lint/git-subtree-check.sh src/crypto/ctaes
test/lint/git-subtree-check.sh src/secp256k1
test/lint/git-subtree-check.sh src/univalue
test/lint/git-subtree-check.sh src/leveldb
test/lint/git-subtree-check.sh src/crc32c
test/lint/check-doc.py
test/lint/check-rpc-mappings.py .
test/lint/lint-all.sh
Expand Down
133 changes: 100 additions & 33 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]])
fi

enable_hwcrc32=no
enable_sse42=no
enable_sse41=no
enable_avx2=no
enable_shani=no
Expand All @@ -365,14 +365,16 @@ if test "x$use_asm" = "xyes"; then
dnl Check for optional instruction set support. Enabling these does _not_ imply that all code will
dnl be compiled with them, rather that specific objects/libs may use them after checking for runtime
dnl compatibility.

dnl x86
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-msse4.1],[[SSE41_CXXFLAGS="-msse4.1"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-mavx -mavx2],[[AVX2_CXXFLAGS="-mavx -mavx2"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-msse4 -msha],[[SHANI_CXXFLAGS="-msse4 -msha"]],,[[$CXXFLAG_WERROR]])

TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS"
AC_MSG_CHECKING(for assembler crc32 support)
AC_MSG_CHECKING(for SSE4.2 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#if defined(_MSC_VER)
Expand All @@ -387,7 +389,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
l = _mm_crc32_u64(l, 0);
return l;
]])],
[ AC_MSG_RESULT(yes); enable_hwcrc32=yes],
[ AC_MSG_RESULT(yes); enable_sse42=yes],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"
Expand Down Expand Up @@ -439,6 +441,24 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
)
CXXFLAGS="$TEMP_CXXFLAGS"

# ARM
AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc+crypto],[[ARM_CRC_CXXFLAGS="-march=armv8-a+crc+crypto"]],,[[$CXXFLAG_WERROR]])

TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $ARM_CRC_CXXFLAGS"
AC_MSG_CHECKING(for ARM CRC32 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <arm_acle.h>
#include <arm_neon.h>
]],[[
__crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0);
vmull_p64(0, 0);
]])],
[ AC_MSG_RESULT(yes); enable_arm_crc=yes; ],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"

fi

CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
Expand Down Expand Up @@ -517,7 +537,6 @@ case $host in
fi

CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601"
LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
if test "x$CXXFLAGS_overridden" = "xno"; then
CXXFLAGS="$CXXFLAGS -w"
fi
Expand All @@ -533,7 +552,6 @@ case $host in
;;
*darwin*)
TARGET_OS=darwin
LEVELDB_TARGET_FLAGS="-DOS_MACOSX"
if test x$cross_compiling != xyes; then
BUILD_OS=darwin
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
Expand Down Expand Up @@ -585,35 +603,9 @@ case $host in
*android*)
dnl make sure android stays above linux for hosts like *linux-android*
TARGET_OS=android
LEVELDB_TARGET_FLAGS="-DOS_ANDROID"
;;
*linux*)
TARGET_OS=linux
LEVELDB_TARGET_FLAGS="-DOS_LINUX"
;;
*kfreebsd*)
LEVELDB_TARGET_FLAGS="-DOS_KFREEBSD"
;;
*freebsd*)
LEVELDB_TARGET_FLAGS="-DOS_FREEBSD"
;;
*openbsd*)
LEVELDB_TARGET_FLAGS="-DOS_OPENBSD"
;;
*netbsd*)
LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
;;
*dragonfly*)
LEVELDB_TARGET_FLAGS="-DOS_DRAGONFLYBSD"
;;
*solaris*)
LEVELDB_TARGET_FLAGS="-DOS_SOLARIS"
;;
*hpux*)
LEVELDB_TARGET_FLAGS="-DOS_HPUX"
;;
*)
AC_MSG_ERROR(Cannot build leveldb for $host. Please file a bug report.)
;;
esac

Expand Down Expand Up @@ -960,6 +952,72 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>
[ AC_MSG_RESULT(no)]
)

dnl LevelDB platform checks
AC_MSG_CHECKING(for fdatasync)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
[[ fdatasync(0); ]])],
[ AC_MSG_RESULT(yes); HAVE_FDATASYNC=1 ],
[ AC_MSG_RESULT(no); HAVE_FDATASYNC=0 ]
)

AC_MSG_CHECKING(for F_FULLFSYNC)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
[[ fcntl(0, F_FULLFSYNC, 0); ]])],
[ AC_MSG_RESULT(yes); HAVE_FULLFSYNC=1 ],
[ AC_MSG_RESULT(no); HAVE_FULLFSYNC=0 ]
)

AC_MSG_CHECKING(for O_CLOEXEC)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
[[ open("", O_CLOEXEC); ]])],
[ AC_MSG_RESULT(yes); HAVE_O_CLOEXEC=1 ],
[ AC_MSG_RESULT(no); HAVE_O_CLOEXEC=0 ]
)

dnl crc32c platform checks
AC_MSG_CHECKING(for __builtin_prefetch)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
char data = 0;
const char* address = &data;
__builtin_prefetch(address, 0, 0);
]])],
[ AC_MSG_RESULT(yes); HAVE_BUILTIN_PREFETCH=1 ],
[ AC_MSG_RESULT(no); HAVE_BUILTIN_PREFETCH=0 ]
)

AC_MSG_CHECKING(for _mm_prefetch)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xmmintrin.h>]], [[
char data = 0;
const char* address = &data;
_mm_prefetch(address, _MM_HINT_NTA);
]])],
[ AC_MSG_RESULT(yes); HAVE_MM_PREFETCH=1 ],
[ AC_MSG_RESULT(no); HAVE_MM_PREFETCH=0 ]
)

AC_MSG_CHECKING(for strong getauxval support in the system headers)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <arm_acle.h>
#include <arm_neon.h>
#include <sys/auxv.h>
]], [[
getauxval(AT_HWCAP);
]])],
[ AC_MSG_RESULT(yes); HAVE_STRONG_GETAUXVAL=1 ],
[ AC_MSG_RESULT(no); HAVE_STRONG_GETAUXVAL=0 ]
)

AC_MSG_CHECKING(for weak getauxval support in the compiler)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
unsigned long getauxval(unsigned long type) __attribute__((weak));
#define AT_HWCAP 16
]], [[
getauxval(AT_HWCAP);
]])],
[ AC_MSG_RESULT(yes); HAVE_WEAK_GETAUXVAL=1 ],
[ AC_MSG_RESULT(no); HAVE_WEAK_GETAUXVAL=0 ]
)

dnl Check for reduced exports
if test x$use_reduce_exports = xyes; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
Expand Down Expand Up @@ -1515,11 +1573,13 @@ AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
AM_CONDITIONAL([ENABLE_SSE42],[test x$enable_sse42 = xyes])
AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes])
AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
AM_CONDITIONAL([ENABLE_ARM_CRC],[test x$enable_arm_crc = xyes])
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
AM_CONDITIONAL([WORDS_BIGENDIAN],[test x$ac_cv_c_bigendian = xyes])

AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
Expand Down Expand Up @@ -1566,18 +1626,25 @@ AC_SUBST(SSE42_CXXFLAGS)
AC_SUBST(SSE41_CXXFLAGS)
AC_SUBST(AVX2_CXXFLAGS)
AC_SUBST(SHANI_CXXFLAGS)
AC_SUBST(ARM_CRC_CXXFLAGS)
AC_SUBST(LIBTOOL_APP_LDFLAGS)
AC_SUBST(USE_UPNP)
AC_SUBST(USE_QRCODE)
AC_SUBST(BOOST_LIBS)
AC_SUBST(TESTDEFS)
AC_SUBST(LEVELDB_TARGET_FLAGS)
AC_SUBST(MINIUPNPC_CPPFLAGS)
AC_SUBST(MINIUPNPC_LIBS)
AC_SUBST(EVENT_LIBS)
AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(QR_LIBS)
AC_SUBST(HAVE_FDATASYNC)
AC_SUBST(HAVE_FULLFSYNC)
AC_SUBST(HAVE_O_CLOEXEC)
AC_SUBST(HAVE_BUILTIN_PREFETCH)
AC_SUBST(HAVE_MM_PREFETCH)
AC_SUBST(HAVE_STRONG_GETAUXVAL)
AC_SUBST(HAVE_WEAK_GETAUXVAL)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
Expand Down
1 change: 1 addition & 0 deletions contrib/devtools/copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"src/leveldb/",
"src/secp256k1/",
"src/univalue/",
"src/crc32c/",
]

INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.mm', '*.py', '*.sh', '*.bash-completion']
Expand Down
3 changes: 2 additions & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,8 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = src/leveldb \
EXCLUDE = src/crc32c \
src/leveldb \
src/json \
src/test \
src/qt/test
Expand Down
4 changes: 4 additions & 0 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,10 @@ Current subtrees include:
- **Note**: Follow the instructions in [Upgrading LevelDB](#upgrading-leveldb) when
merging upstream changes to the LevelDB subtree.

- src/crc32c
- Used by leveldb for hardware acceleration of CRC32C checksums for data integrity.
- Upstream at https://github.com/google/crc32c ; Maintained by Google.

- src/secp256k1
- Upstream at https://github.com/bitcoin-core/secp256k1/ ; actively maintained by Core contributors.

Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ if HARDEN
endif

if EMBEDDED_LEVELDB
include Makefile.crc32c.include
include Makefile.leveldb.include
endif

Expand Down
75 changes: 75 additions & 0 deletions src/Makefile.crc32c.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

LIBCRC32C_INT = crc32c/libcrc32c.a
LIBLEVELDB_SSE42_INT = leveldb/libleveldb_sse42.a

EXTRA_LIBRARIES += $(LIBCRC32C_INT)

LIBCRC32C = $(LIBCRC32C_INT)

CRC32C_CPPFLAGS_INT =
CRC32C_CPPFLAGS_INT += -I$(srcdir)/crc32c/include
CRC32C_CPPFLAGS_INT += -DHAVE_BUILTIN_PREFETCH=@HAVE_BUILTIN_PREFETCH@
CRC32C_CPPFLAGS_INT += -DHAVE_MM_PREFETCH=@HAVE_MM_PREFETCH@
CRC32C_CPPFLAGS_INT += -DHAVE_STRONG_GETAUXVAL=@HAVE_STRONG_GETAUXVAL@
CRC32C_CPPFLAGS_INT += -DHAVE_WEAK_GETAUXVAL=@HAVE_WEAK_GETAUXVAL@
CRC32C_CPPFLAGS_INT += -DCRC32C_TESTS_BUILT_WITH_GLOG=0

if ENABLE_SSE42
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=1
else
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=0
endif

if ENABLE_ARM_CRC
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=1
else
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=0
endif

if WORDS_BIGENDIAN
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=1
else
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0
endif

crc32c_libcrc32c_a_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS)
crc32c_libcrc32c_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

crc32c_libcrc32c_a_SOURCES =
crc32c_libcrc32c_a_SOURCES += crc32c/include/crc32c/crc32c.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64_linux_check.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_internal.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_prefetch.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_read_le.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_round_up.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42_check.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42.h

crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c.cc
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_portable.cc

if ENABLE_SSE42
LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.a
EXTRA_LIBRARIES += $(LIBCRC32C_SSE42_INT)
LIBCRC32C += $(LIBCRC32C_SSE42_INT)

crc32c_libcrc32c_sse42_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS)
crc32c_libcrc32c_sse42_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(SSE42_CXXFLAGS)

crc32c_libcrc32c_sse42_a_SOURCES = crc32c/src/crc32c_sse42.cc
endif

if ENABLE_ARM_CRC
LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.a
EXTRA_LIBRARIES += $(LIBCRC32C_ARM_CRC_INT)
LIBCRC32C += $(LIBCRC32C_ARM_CRC_INT)

crc32c_libcrc32c_arm_crc_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS)
crc32c_libcrc32c_arm_crc_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(ARM_CRC_CXXFLAGS)

crc32c_libcrc32c_arm_crc_a_SOURCES = crc32c/src/crc32c_arm64.cc
endif
Loading

0 comments on commit 22d1118

Please sign in to comment.