Halide icon indicating copy to clipboard operation
Halide copied to clipboard

[macos] XCode 15 issues warnings for object files when linking

Open derek-gerstmann opened this issue 1 year ago • 2 comments

It appears XCode 15 now includes a custom (undocumented) version of LD which expects object files to be generated with a version number specified in the OS part of the LLVM target triple, otherwise it issues warnings like:

ld: warning: no platform load command found in 'static-lib.a[0](object-file.o)', assuming: macOS

This appears to have hit the JuliaLang team too, and they discovered they had to update their target triple for AOT compilation to include the OS version: https://github.com/JuliaLang/julia/pull/51830

More discussion here: https://github.com/JuliaLang/julia/issues/51562

So, it appears we may need to update the LLVM object file output to include the darwin/macos minimum deployment version in the target triple to be compatible with XCode 15 and future Apple toolchains.

derek-gerstmann avatar Nov 09 '23 18:11 derek-gerstmann

We have an issue I need to report where the new linker generates bad object code on ARM. I mentioned it to Andrew. I doubt fixing this warning would fix the error in question as it is generating a straight up illegal instruction.

zvookin avatar Nov 09 '23 18:11 zvookin

More info on this ... apparently Apple wants LC_BUILD_VERSION to be set for all valid mach-o object files: https://github.com/rust-lang/rust/pull/114114

derek-gerstmann avatar Feb 16 '24 21:02 derek-gerstmann