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

Tier 1 Support for x86_64 macOS #4897

Closed
andrewrk opened this issue Apr 1, 2020 · 6 comments
Closed

Tier 1 Support for x86_64 macOS #4897

andrewrk opened this issue Apr 1, 2020 · 6 comments
Labels
arch-x86_64 64-bit x86 enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-macos
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Apr 1, 2020

I just demoted macOS from Tier 1 to Tier 2 support on the support table, because the requirements for Tier 1 say this:

libc is available for this target even when cross compiling.

Here are some of the roadblocks for cross-compiling targeting macOS:

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-macos arch-x86_64 64-bit x86 labels Apr 1, 2020
@andrewrk andrewrk added this to the 0.7.0 milestone Apr 1, 2020
@robinsoncol
Copy link
Contributor

I couldn't get the latest version of Zig to build on macOS Catalina. Is the build problem that I'm having related to this issue?

Here's the error that I'm getting:

[ 99%] Linking CXX executable zig0
Undefined symbols for architecture x86_64:
  "getPollyPluginInfo()", referenced from:
      (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) in libclangCodeGen.a(BackendUtil.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [zig0] Error 1
make[1]: *** [CMakeFiles/zig0.dir/all] Error 2
make: *** [all] Error 2

cmake 3.17.0_1
llvm 10.0

@fengb
Copy link
Contributor

fengb commented Apr 1, 2020

@robinsoncol Homebrew’s LLVM is misconfigured: Homebrew/homebrew-core#52352

Edit: I was mistaken. Workaround is -DZIG_PREFER_CLANG_CPP_DYLIB=ON to cmake.

LLVM makes it impossible to configure this in a robust way. Discussion in #4799 (comment) and upstream https://bugs.llvm.org/show_bug.cgi?id=44870

@kubkon
Copy link
Member

kubkon commented Dec 20, 2020

@andrewrk can we revisit this? Out of the list posted in the issue's description:

  • libc is available for this target even when cross compiling
  • LLD linker macho code is unmaintained this is actually resolved now
  • darwin frameworks (ability to link against darwin frameworks (such as CoreFoundation) when cross compiling #1349)
  • Apple has not been careful with the license in their header files and it does not look like we can ship their .h files. So we would need a clean room implementation of darwin libc header files.
  • The requirement for applications to be signed causes problems

only the 3rd bullet is still relevant (and probably will be for quite some time); however, the rest seems addressed by now including shipping libc headers for both aarch64-macos-gnu and x86_64-macos-gnu targets. In the light of this plus the fact that the work on self-hosted Mach-O linker is progressing at a steady pace, I'd like to propose we promote macOS back to Tier 1 for x86_64 and introduce arm64 as Tier 2. If there are no objections, I'll be happy to submit relevant changes to the website.

@andrewrk
Copy link
Member Author

I agree, thanks to your diligent work, zig now has tier 1 support for x86_64-macos! Would you like to do the honors of closing this issue?

@kubkon
Copy link
Member

kubkon commented Dec 20, 2020

I agree, thanks to your diligent work, zig now has tier 1 support for x86_64-macos! Would you like to do the honors of closing this issue?

Oh absolutely, thanks!

@kubkon
Copy link
Member

kubkon commented Dec 20, 2020

PR upgrading x86_64 to tier 1, and introducing arm64 as tier 2: ziglang/www.ziglang.org#86

@kubkon kubkon closed this as completed Dec 20, 2020
@Vexu Vexu modified the milestones: 0.9.0, 0.8.0 Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-x86_64 64-bit x86 enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-macos
Projects
None yet
Development

No branches or pull requests

5 participants