Skip to content

Commit 8877183

Browse files
iancha1992copybara-github
authored andcommitted
Mark gcc-<version> as gcc instead of compiler in Unix CC toolchain
Fixes #17794 I was looking at writing a test for this, but not sure how you'd like me to go about that. Hard-code a gcc, e.g. `gcc-11`, or search the `$PATH` for a `gcc-<version>`? Closes #20350. PiperOrigin-RevId: 604543138 Change-Id: I71ebbac77e4e32ebc5d99ec4a81415727af12cbc
1 parent 5ab21e0 commit 8877183

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/tools/bzlmod/MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/cpp/unix_cc_configure.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ def _is_clang(repository_ctx, cc):
272272
def _is_gcc(repository_ctx, cc):
273273
# GCC's version output uses the basename of argv[0] as the program name:
274274
# https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.cc;h=158461167951c1b9540322fb19be6a89d6da07fc;hb=HEAD#l8728
275-
return repository_ctx.execute([cc, "--version"]).stdout.startswith("gcc ")
275+
cc_stdout = repository_ctx.execute([cc, "--version"]).stdout
276+
return cc_stdout.startswith("gcc ") or cc_stdout.startswith("gcc-")
276277

277278
def _get_compiler_name(repository_ctx, cc):
278279
if _is_clang(repository_ctx, cc):

0 commit comments

Comments
 (0)