Skip to content

Commit

Permalink
PR #20340: Fix missing template value
Browse files Browse the repository at this point in the history
Imported from GitHub PR openxla/xla#20340

Fixes a bug introduced in this change: #2944

The change makes use of a template variable `%{compiler}`, that is not defined for this file. This causes the `-fno-canonical-system-headers` option to be set for Clang builds, and Clang will fail with an error about that command line flag not being defined.
Copybara import of the project:

--
75a3d3fbcf2ead55df3872aa80ff21ac3dd9336c by Charles Hofer <[email protected]>:

Fix missing template value

--
e08537b09200b0037db7a05780dea0d525399376 by Charles Hofer <[email protected]>:

Change flag to compiler_is_clang

--
373f359cbd8d02ee850d98fed92a7bbca4a09c1b by Charles Hofer <[email protected]>:

Fix typo

--
2be3c309d05f93a48dd9fdd06af8159108920516 by Harsha HS <[email protected]>:

[ROCm] Add cuda-only tags for nvidia profiler test

Merging this change closes #20340

PiperOrigin-RevId: 714293326
  • Loading branch information
charleshofer authored and copybara-github committed Jan 11, 2025
1 parent 7fcedb0 commit 0f6571f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import pipes

# Template values set by rocm_configure.bzl.
CPU_COMPILER = ('%{cpu_compiler}')
USE_CLANG = ('%{compiler}' == 'clang')
USE_CLANG = ('%{compiler_is_clang}' == 'True')
HOST_COMPILER_PATH = ('%{host_compiler_path}')

HIPCC_PATH = '%{hipcc_path}'
Expand Down
2 changes: 1 addition & 1 deletion third_party/gpus/rocm_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def _create_local_rocm_repository(repository_ctx):
tpl_paths["crosstool:clang/bin/crosstool_wrapper_driver_rocm"],
{
"%{cpu_compiler}": str(cc),
"%{compiler}": rocm_defines["%{compiler}"],
"%{compiler_is_clang}": "True" if is_rocm_clang else "False",
"%{hipcc_path}": str(repository_ctx.path(rocm_config.rocm_toolkit_path + "/bin/hipcc")),
"%{hipcc_env}": _hipcc_env(repository_ctx),
"%{rocm_path}": str(repository_ctx.path(rocm_config.rocm_toolkit_path)),
Expand Down

0 comments on commit 0f6571f

Please sign in to comment.