Skip to content

Commit

Permalink
Merge bitcoin-core/secp256k1#1402: ci: Use Homebrew's gcc in native m…
Browse files Browse the repository at this point in the history
…acOS task

d62db57 ci: Use Homebrew's gcc in native macOS task (Hennadii Stepanov)

Pull request description:

  Fixes an issue noticed in bitcoin-core/secp256k1#1394 (comment):

  > This uses the wrong GCC, namely Clang

  When `CC=gcc`:

  - on the [master](https://api.cirrus-ci.com/v1/task/5074854529990656/logs/test.log) branch:
  ```
  + gcc -v
  Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  Target: arm64-apple-darwin22.5.0
  Thread model: posix
  InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  ```

  - with this [PR](https://api.cirrus-ci.com/v1/task/5460539170619392/logs/test.log):
  ```
  + gcc -v
  Using built-in specs.
  COLLECT_GCC=gcc
  COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/aarch64-apple-darwin22/13/lto-wrapper
  Target: aarch64-apple-darwin22
  Configured with: ../configure --prefix=/opt/homebrew/opt/gcc --libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-13 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 13.1.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=aarch64-apple-darwin22 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
  Thread model: posix
  Supported LTO compression algorithms: zlib zstd
  gcc version 13.1.0 (Homebrew GCC 13.1.0)
  ```

ACKs for top commit:
  real-or-random:
    ACK d62db57, it works: https://cirrus-ci.com/task/6200190252613632?logs=test#L27

Tree-SHA512: 34b3aa86584fc04b57301731ebf811cd5b457cebb13e64593b8efb776aec48c1be5d2662b1af3f482d39fdb43308dafa5f4bfc18bd2cf350f0f61f0be799346e
  • Loading branch information
real-or-random committed Aug 16, 2023
2 parents eedd781 + d62db57 commit b327abf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ task:
- env: {BUILD: distcheck}
brew_script:
- brew install automake libtool gcc
- ln -s /opt/homebrew/bin/gcc-?? /opt/homebrew/bin/gcc
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS
Expand Down
7 changes: 7 additions & 0 deletions ci/cirrus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ esac

env >> test_env.log

# If gcc is requested, assert that it's in fact gcc (and not some symlinked Apple clang).
case "${CC:-undefined}" in
*gcc*)
$CC -v 2>&1 | grep -q "gcc version" || exit 1;
;;
esac

if [ -n "${CC+x}" ]; then
# The MSVC compiler "cl" doesn't understand "-v"
$CC -v || true
Expand Down

0 comments on commit b327abf

Please sign in to comment.