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.
19 KiB
19 KiB