[all-commits] [llvm/llvm-project] c45d2d: [Clang] Add options in LTO mode when cross compili...

Joseph Huber via All-commits all-commits at lists.llvm.org
Wed Feb 22 08:14:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c45d2df05e0e7b6f2517aa2933a24928b4942a3f
      https://github.com/llvm/llvm-project/commit/c45d2df05e0e7b6f2517aa2933a24928b4942a3f
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/test/Driver/amdgpu-toolchain.c

  Log Message:
  -----------
  [Clang] Add options in LTO mode when cross compiling for AMDGPU

The AMDGPU toolchain support directly compiling GPU images using
cross-compilation such as `clang --target=amdgcn-amd-amdhsa foo.c`.
However, when attempting to link bitcode this does not work because the
`-mcpu` options are not forwarded to the linker among others. This patch
simply adds them so that `clang --target=amdgcn-amd-amdhsa foo.c -flto`
works correctly.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D144505




More information about the All-commits mailing list