Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
derek-gerstmann opened this issue Nov 9, 2023 · 2 comments · Fixed by #8323
Closed

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

derek-gerstmann opened this issue Nov 9, 2023 · 2 comments · Fixed by #8323

Comments

@derek-gerstmann
Copy link
Contributor

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:
JuliaLang/julia#51830

More discussion here:
JuliaLang/julia#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.

@zvookin
Copy link
Member

zvookin commented Nov 9, 2023

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.

@derek-gerstmann
Copy link
Contributor Author

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

alexreinking added a commit that referenced this issue Jun 25, 2024
This gives LLVM enough information to generate a
"platform load-command" in the MachO object file.

Fixes #7941
alexreinking added a commit that referenced this issue Jun 25, 2024
This gives LLVM enough information to generate a
"platform load-command" in the MachO object file.

Fixes #7941
alexreinking added a commit that referenced this issue Jun 25, 2024
This gives LLVM enough information to generate a
"platform load-command" in the object file.

Fixes #7941
alexreinking added a commit that referenced this issue Jun 25, 2024
This gives LLVM enough information to generate a
"platform load-command" in the object file.

Fixes #7941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants