[all-commits] [llvm/llvm-project] 264ac2: [HIP][MacOS] Mach-O support and Darwin toolchain f...

Paulius Velesko via All-commits all-commits at lists.llvm.org
Tue Apr 28 10:44:20 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 264ac2d3af1b97705225f623f4561be51163e6e3
      https://github.com/llvm/llvm-project/commit/264ac2d3af1b97705225f623f4561be51163e6e3
  Author: Paulius Velesko <pvelesko at pglc.io>
  Date:   2026-04-28 (Tue, 28 Apr 2026)

  Changed paths:
    M clang/lib/CodeGen/CGCUDANV.cpp
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/lib/Driver/ToolChains/Darwin.h
    M clang/lib/Driver/ToolChains/HIPUtility.cpp
    A clang/test/CodeGenCUDA/device-stub-macho.cu
    M clang/test/CodeGenCUDA/offloading-entries.cu
    M clang/test/Driver/linker-wrapper-image.c
    M llvm/include/llvm/Frontend/Offloading/Utility.h
    M llvm/lib/Frontend/Offloading/OffloadWrapper.cpp
    M llvm/lib/Frontend/Offloading/Utility.cpp
    M llvm/test/tools/llvm-offload-wrapper/offload-wrapper.ll

  Log Message:
  -----------
  [HIP][MacOS] Mach-O support and Darwin toolchain fixes (#183991)

This PR adds support for HIP on macOS: Mach-O section naming, Darwin
host toolchain initialization guards, and HIPSPV behavior when Darwin is
the host.

This has been verified using chipStar on MacOS via the PoCL OpenCL
implementation.

## Uninitialized target workaround
Darwin’s toolchain is only initialized when its own TranslateArgs runs.
For HIP/CUDA device jobs, Darwin is used as the HostTC and never gets
its args translated, so its target stays uninitialized. The new checks
avoid asserting on that uninitialized state. A better long-term fix is
to initialize Darwin earlier (see the FIXME in Driver.cpp
BuildJobsForAction).

- [ ] Initialize Darwin toolchain during construction instead of lazily
in TranslateArgs. See Driver.cpp BuildJobsForAction FIXME.

- [x] In Darwin’s addClangTargetOptions, skip host-stdlib flags when
DeviceOffloadKind != OFK_None so HIPSPV can safely delegate to the host.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list