mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-30 15:31:39 +02:00
Merge bitcoin/bitcoin#33151: subtree: update crc32c subtree
9a5d29711a
Squashed 'src/crc32c/' changes from b60d2b7334..efb8ea04e4 (fanquake) Pull request description: Sync the subtree with latest upstream. The changes here are a no-op, but pull them to fix the drive-by-typo-fixing: #33057. Includes https://github.com/bitcoin-core/crc32c-subtree/pull/8. ACKs for top commit: maflcko: lgtm ACK8ef8dd6871
janb84: ACK8ef8dd6871
Tree-SHA512: b20a47514218206b934c4aa27ec667fb9b3ec7f7388a78725c52fc6e916358d2b9a2075a37808dbc2430b4c7816511ecf20e36bfe2fbd2d8a26bc8882a46d5e7
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
# Build matrix / environment variables are explained on:
|
|
||||||
# https://www.appveyor.com/docs/appveyor-yml/
|
|
||||||
# This file can be validated on: https://ci.appveyor.com/tools/validate-yaml
|
|
||||||
|
|
||||||
version: "{build}"
|
|
||||||
|
|
||||||
environment:
|
|
||||||
matrix:
|
|
||||||
# AppVeyor currently has no custom job name feature.
|
|
||||||
# http://help.appveyor.com/discussions/questions/1623-can-i-provide-a-friendly-name-for-jobs
|
|
||||||
- JOB: Visual Studio 2019
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
||||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
|
||||||
|
|
||||||
platform:
|
|
||||||
- x86
|
|
||||||
- x64
|
|
||||||
|
|
||||||
configuration:
|
|
||||||
- RelWithDebInfo
|
|
||||||
- Debug
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- if "%platform%"=="x86" (set CMAKE_GENERATOR_PLATFORM="Win32")
|
|
||||||
else (set CMAKE_GENERATOR_PLATFORM="%platform%")
|
|
||||||
- cmake --version
|
|
||||||
- cmake .. -G "%CMAKE_GENERATOR%" -A "%CMAKE_GENERATOR_PLATFORM%"
|
|
||||||
-DCMAKE_CONFIGURATION_TYPES="%CONFIGURATION%" -DCRC32C_USE_GLOG=0
|
|
||||||
- cmake --build . --config "%CONFIGURATION%"
|
|
||||||
- cd ..
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
- build\%CONFIGURATION%\crc32c_tests.exe
|
|
||||||
- build\%CONFIGURATION%\crc32c_capi_tests.exe
|
|
||||||
- build\%CONFIGURATION%\crc32c_bench.exe
|
|
102
src/crc32c/.github/workflows/build.yml
vendored
Normal file
102
src/crc32c/.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Copyright 2021 The CRC32C Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
|
name: ci
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-test:
|
||||||
|
name: >-
|
||||||
|
CI
|
||||||
|
${{ matrix.os }}
|
||||||
|
${{ matrix.compiler }}
|
||||||
|
${{ matrix.optimized && 'release' || 'debug' }}
|
||||||
|
${{ matrix.shared_lib && 'shared' || 'static' }}
|
||||||
|
${{ matrix.use_glog && 'glog' || 'no-glog' }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
compiler: [clang, gcc, msvc]
|
||||||
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
optimized: [true, false]
|
||||||
|
shared_lib: [true, false]
|
||||||
|
use_glog: [true, false]
|
||||||
|
exclude:
|
||||||
|
# Our glog config doesn't work with shared libraries.
|
||||||
|
- use_glog: true
|
||||||
|
shared_lib: true
|
||||||
|
# MSVC only works on Windows.
|
||||||
|
- os: ubuntu-latest
|
||||||
|
compiler: msvc
|
||||||
|
- os: macos-latest
|
||||||
|
compiler: msvc
|
||||||
|
# Not testing with GCC on macOS.
|
||||||
|
- os: macos-latest
|
||||||
|
compiler: gcc
|
||||||
|
# Only testing with MSVC on Windows.
|
||||||
|
- os: windows-latest
|
||||||
|
compiler: clang
|
||||||
|
- os: windows-latest
|
||||||
|
compiler: gcc
|
||||||
|
# Not testing fringe configurations (glog, shared libraries) on Windows.
|
||||||
|
- os: windows-latest
|
||||||
|
use_glog: true
|
||||||
|
- os: windows-latest
|
||||||
|
shared_lib: true
|
||||||
|
include:
|
||||||
|
- compiler: clang
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
- compiler: gcc
|
||||||
|
CC: gcc
|
||||||
|
CXX: g++
|
||||||
|
- compiler: msvc
|
||||||
|
CC:
|
||||||
|
CXX:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
|
||||||
|
CMAKE_BUILD_TYPE: ${{ matrix.optimized && 'RelWithDebInfo' || 'Debug' }}
|
||||||
|
CC: ${{ matrix.CC }}
|
||||||
|
CXX: ${{ matrix.CXX }}
|
||||||
|
BINARY_SUFFIX: ${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
|
||||||
|
BINARY_PATH: >-
|
||||||
|
${{ format(
|
||||||
|
startsWith(matrix.os, 'windows') && '{0}\build\{1}\' || '{0}/build/',
|
||||||
|
github.workspace,
|
||||||
|
matrix.optimized && 'RelWithDebInfo' || 'Debug') }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Generate build config
|
||||||
|
run: >-
|
||||||
|
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}"
|
||||||
|
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/install_test/
|
||||||
|
-DBUILD_SHARED_LIBS=${{ matrix.shared_lib && '1' || '0' }}
|
||||||
|
-DCRC32C_USE_GLOG=${{ matrix.use_glog && '1' || '0' }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: >-
|
||||||
|
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
|
||||||
|
--config "${{ env.CMAKE_BUILD_TYPE }}"
|
||||||
|
|
||||||
|
- name: Run C++ API Tests
|
||||||
|
run: ${{ env.BINARY_PATH }}crc32c_tests${{ env.BINARY_SUFFIX }}
|
||||||
|
|
||||||
|
- name: Run C API Tests
|
||||||
|
run: ${{ env.BINARY_PATH }}crc32c_capi_tests${{ env.BINARY_SUFFIX }}
|
||||||
|
|
||||||
|
- name: Run Benchmarks
|
||||||
|
run: ${{ env.BINARY_PATH }}crc32c_bench${{ env.BINARY_SUFFIX }}
|
||||||
|
|
||||||
|
- name: Test CMake installation
|
||||||
|
run: cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install
|
1
src/crc32c/.gitignore
vendored
1
src/crc32c/.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# Editors.
|
# Editors.
|
||||||
*.sw*
|
*.sw*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/.cache
|
||||||
/.vscode
|
/.vscode
|
||||||
|
|
||||||
# Build directory.
|
# Build directory.
|
||||||
|
@@ -1,76 +0,0 @@
|
|||||||
# Build matrix / environment variables are explained on:
|
|
||||||
# http://about.travis-ci.org/docs/user/build-configuration/
|
|
||||||
# This file can be validated on: http://lint.travis-ci.org/
|
|
||||||
|
|
||||||
language: cpp
|
|
||||||
dist: bionic
|
|
||||||
osx_image: xcode12.5
|
|
||||||
|
|
||||||
compiler:
|
|
||||||
- gcc
|
|
||||||
- clang
|
|
||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
|
|
||||||
env:
|
|
||||||
- GLOG=1 SHARED_LIB=0 BUILD_TYPE=Debug
|
|
||||||
- GLOG=1 SHARED_LIB=0 BUILD_TYPE=RelWithDebInfo
|
|
||||||
- GLOG=0 SHARED_LIB=0 BUILD_TYPE=Debug
|
|
||||||
- GLOG=0 SHARED_LIB=0 BUILD_TYPE=RelWithDebInfo
|
|
||||||
- GLOG=0 SHARED_LIB=1 BUILD_TYPE=Debug
|
|
||||||
- GLOG=0 SHARED_LIB=1 BUILD_TYPE=RelWithDebInfo
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main'
|
|
||||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
|
||||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
|
||||||
packages:
|
|
||||||
- clang-12
|
|
||||||
- cmake
|
|
||||||
- gcc-11
|
|
||||||
- g++-11
|
|
||||||
- ninja-build
|
|
||||||
homebrew:
|
|
||||||
packages:
|
|
||||||
- cmake
|
|
||||||
- gcc@11
|
|
||||||
- llvm@12
|
|
||||||
- ninja
|
|
||||||
update: true
|
|
||||||
|
|
||||||
install:
|
|
||||||
# The following Homebrew packages aren't linked by default, and need to be
|
|
||||||
# prepended to the path explicitly.
|
|
||||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
|
||||||
export PATH="$(brew --prefix llvm)/bin:$PATH";
|
|
||||||
fi
|
|
||||||
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
|
|
||||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-11" CC="gcc-11"; fi
|
|
||||||
# /usr/bin/clang points to an older compiler on both Linux and macOS.
|
|
||||||
#
|
|
||||||
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
|
|
||||||
# below don't work on macOS. Fortunately, the path change above makes the
|
|
||||||
# default values (clang and clang++) resolve to the correct compiler on macOS.
|
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
|
||||||
if [ "$CXX" = "clang++" ]; then export CXX="clang++-12" CC="clang-12"; fi;
|
|
||||||
fi
|
|
||||||
- echo ${CC}
|
|
||||||
- echo ${CXX}
|
|
||||||
- ${CXX} --version
|
|
||||||
- cmake --version
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- mkdir -p build && cd build
|
|
||||||
- cmake .. -G Ninja -DCRC32C_USE_GLOG=$GLOG -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
||||||
-DBUILD_SHARED_LIBS=$SHARED_LIB -DCMAKE_INSTALL_PREFIX=$HOME/.local
|
|
||||||
- cmake --build .
|
|
||||||
- cd ..
|
|
||||||
|
|
||||||
script:
|
|
||||||
- build/crc32c_tests
|
|
||||||
- build/crc32c_capi_tests
|
|
||||||
- build/crc32c_bench
|
|
||||||
- cd build && cmake --build . --target install
|
|
@@ -368,6 +368,12 @@ if(CRC32C_BUILD_TESTS)
|
|||||||
# Warnings as errors in Visual Studio for this project's targets.
|
# Warnings as errors in Visual Studio for this project's targets.
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")
|
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")
|
||||||
|
|
||||||
|
# The Windows SDK version currently on CI produces warnings when some
|
||||||
|
# headers are #included using C99 compatibility mode or above. This
|
||||||
|
# workaround can be removed once the Windows SDK on our CI is upgraded.
|
||||||
|
set_property(TARGET crc32c_capi_tests
|
||||||
|
APPEND PROPERTY COMPILE_OPTIONS "/wd5105")
|
||||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
|
||||||
add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)
|
add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
# CRC32C
|
# CRC32C
|
||||||
|
|
||||||
[](https://travis-ci.org/google/crc32c)
|
[](https://github.com/google/crc32c/actions/workflows/build.yml)
|
||||||
[](https://ci.appveyor.com/project/pwnall/crc32c)
|
|
||||||
|
|
||||||
New file format authors should consider
|
New file format authors should consider
|
||||||
[HighwayHash](https://github.com/google/highwayhash). The initial version of
|
[HighwayHash](https://github.com/google/highwayhash). The initial version of
|
||||||
|
@@ -176,7 +176,7 @@ uint32_t ExtendSse42(uint32_t crc, const uint8_t* data, size_t size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proccess the data in predetermined block sizes with tables for quickly
|
// Process the data in predetermined block sizes with tables for quickly
|
||||||
// combining the checksum. Experimentally it's better to use larger block
|
// combining the checksum. Experimentally it's better to use larger block
|
||||||
// sizes where possible so use a hierarchy of decreasing block sizes.
|
// sizes where possible so use a hierarchy of decreasing block sizes.
|
||||||
uint64_t l64 = l;
|
uint64_t l64 = l;
|
||||||
|
Reference in New Issue
Block a user