Skip to content

Commit b327abf

Browse files
Merge #1402: ci: Use Homebrew's gcc in native macOS task
d62db57 ci: Use Homebrew's gcc in native macOS task (Hennadii Stepanov) Pull request description: Fixes an issue noticed in #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
2 parents eedd781 + d62db57 commit b327abf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.cirrus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ task:
139139
- env: {BUILD: distcheck}
140140
brew_script:
141141
- brew install automake libtool gcc
142+
- ln -s /opt/homebrew/bin/gcc-?? /opt/homebrew/bin/gcc
142143
test_script:
143144
- ./ci/cirrus.sh
144145
<< : *CAT_LOGS

ci/cirrus.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ esac
4343

4444
env >> test_env.log
4545

46+
# If gcc is requested, assert that it's in fact gcc (and not some symlinked Apple clang).
47+
case "${CC:-undefined}" in
48+
*gcc*)
49+
$CC -v 2>&1 | grep -q "gcc version" || exit 1;
50+
;;
51+
esac
52+
4653
if [ -n "${CC+x}" ]; then
4754
# The MSVC compiler "cl" doesn't understand "-v"
4855
$CC -v || true

0 commit comments

Comments
 (0)