Skip to content

Commit bd40cd8

Browse files
committed
Merge bitcoin/bitcoin#23133: Update crc32c subtree
1d44513 Squashed 'src/crc32c/' changes from b5ef9be675..0d624261ef (MarcoFalke) Pull request description: Only change is a warning fix for arm. ``` CXX crc32c/src/crc32c_libcrc32c_a-crc32c.o In file included from crc32c/src/crc32c.cc:11:0: crc32c/src/./crc32c_arm64_check.h: In function ‘bool crc32c::CanUseArm64Crc32()’: crc32c/src/./crc32c_arm64_check.h:43:37: warning: the address of ‘long unsigned int getauxval(long unsigned int)’ will never be NULL [-Waddress] unsigned long hwcap = (&getauxval != nullptr) ? getauxval(AT_HWCAP) : 0; ~~~~~~~~~~~^~~~~~~~~~ ACKs for top commit: laanwj: Code review ACK fac1c13 fanquake: ACK fac1c13 Tree-SHA512: 22a52caf67dd89092eff1f075fbf5c5d16bdca9146ba042ce5d3fcc10ce1485e950964089f8536c938ebe650676e03a789d3597fe45b19920fd2c5e72f1391ad
2 parents dbbb7fb + fac1c13 commit bd40cd8

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

src/crc32c/.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
language: cpp
66
dist: bionic
7-
osx_image: xcode10.3
7+
osx_image: xcode12.5
88

99
compiler:
1010
- gcc
@@ -24,20 +24,20 @@ env:
2424
addons:
2525
apt:
2626
sources:
27-
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
27+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main'
2828
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
2929
- sourceline: 'ppa:ubuntu-toolchain-r/test'
3030
packages:
31-
- clang-9
31+
- clang-12
3232
- cmake
33-
- gcc-9
34-
- g++-9
33+
- gcc-11
34+
- g++-11
3535
- ninja-build
3636
homebrew:
3737
packages:
3838
- cmake
39-
- gcc@9
40-
- llvm@9
39+
- gcc@11
40+
- llvm@12
4141
- ninja
4242
update: true
4343

@@ -48,14 +48,14 @@ install:
4848
export PATH="$(brew --prefix llvm)/bin:$PATH";
4949
fi
5050
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
51-
- if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
51+
- if [ "$CXX" = "g++" ]; then export CXX="g++-11" CC="gcc-11"; fi
5252
# /usr/bin/clang points to an older compiler on both Linux and macOS.
5353
#
5454
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
5555
# below don't work on macOS. Fortunately, the path change above makes the
5656
# default values (clang and clang++) resolve to the correct compiler on macOS.
5757
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
58-
if [ "$CXX" = "clang++" ]; then export CXX="clang++-9" CC="clang-9"; fi;
58+
if [ "$CXX" = "clang++" ]; then export CXX="clang++-12" CC="clang-12"; fi;
5959
fi
6060
- echo ${CC}
6161
- echo ${CXX}

src/crc32c/.ycm_extra_conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"""YouCompleteMe configuration that interprets a .clang_complete file.
55
66
This module implementes the YouCompleteMe configuration API documented at:
7-
https://github.com/Valloric/ycmd#ycm_extra_confpy-specification
7+
https://github.com/ycm-core/ycmd#ycm_extra_confpy-specification
88
99
The implementation loads and processes a .clang_complete file, documented at:
10-
https://github.com/Rip-Rip/clang_complete/blob/master/README.md
10+
https://github.com/xavierd/clang_complete/blob/master/README.md
1111
"""
1212

1313
import os

src/crc32c/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ apm install autocomplete-clang build build-cmake clang-format language-cmake \
6565

6666
If you don't mind more setup in return for more speed, replace
6767
`autocomplete-clang` and `linter-clang` with `you-complete-me`. This requires
68-
[setting up ycmd](https://github.com/Valloric/ycmd#building).
68+
[setting up ycmd](https://github.com/ycm-core/ycmd#building).
6969

7070
```bash
7171
apm install autocomplete-plus build build-cmake clang-format language-cmake \

src/crc32c/src/crc32c_arm64_check.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ inline bool CanUseArm64Crc32() {
4040
// From 'arch/arm64/include/uapi/asm/hwcap.h' in Linux kernel source code.
4141
constexpr unsigned long kHWCAP_PMULL = 1 << 4;
4242
constexpr unsigned long kHWCAP_CRC32 = 1 << 7;
43-
unsigned long hwcap = (&getauxval != nullptr) ? getauxval(AT_HWCAP) : 0;
43+
unsigned long hwcap =
44+
#if HAVE_STRONG_GETAUXVAL
45+
// Some compilers warn on (&getauxval != nullptr) in the block below.
46+
getauxval(AT_HWCAP);
47+
#elif HAVE_WEAK_GETAUXVAL
48+
(&getauxval != nullptr) ? getauxval(AT_HWCAP) : 0;
49+
#else
50+
#error This is supposed to be nested inside a check for HAVE_*_GETAUXVAL.
51+
#endif // HAVE_STRONG_GETAUXVAL
4452
return (hwcap & (kHWCAP_PMULL | kHWCAP_CRC32)) ==
4553
(kHWCAP_PMULL | kHWCAP_CRC32);
4654
#elif defined(__APPLE__)

0 commit comments

Comments
 (0)