-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix several issues during cross compiling #98328
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
@jyn514 since you've reviewed my other PR, would you want to check this out too? |
Why does this cause link errors? |
I don't actually know why, but the linker will complain |
Hmm, ok, seems good to have LLVM's build be consistent with rustc's. |
@bors r+ |
📌 Commit 91c7dd0 has been approved by |
Fix several issues during cross compiling - When cross compiling LLVM on an arm64 macOS machine to x86_64, CMake will produce universal binaries by default, causing link errors. Explicitly set `CMAKE_OSX_ARCHITECTURES` to the one single target architecture so that the executables and libraries will be single architecture. - When cross compiling rustc with `llvm.clang = true`, `CLANG_TABLEGEN` has to be set to the host `clang-tblgen` executable to build clang.
Failed in rollup: #98442 (comment) |
@jyn514 turns out that @JohnTitor I have pushed a new update to the PR |
@bors r+ |
📌 Commit 7180afb has been approved by |
Fix several issues during cross compiling - When cross compiling LLVM on an arm64 macOS machine to x86_64, CMake will produce universal binaries by default, causing link errors. Explicitly set `CMAKE_OSX_ARCHITECTURES` to the one single target architecture so that the executables and libraries will be single architecture. - When cross compiling rustc with `llvm.clang = true`, `CLANG_TABLEGEN` has to be set to the host `clang-tblgen` executable to build clang.
Fix several issues during cross compiling - When cross compiling LLVM on an arm64 macOS machine to x86_64, CMake will produce universal binaries by default, causing link errors. Explicitly set `CMAKE_OSX_ARCHITECTURES` to the one single target architecture so that the executables and libraries will be single architecture. - When cross compiling rustc with `llvm.clang = true`, `CLANG_TABLEGEN` has to be set to the host `clang-tblgen` executable to build clang.
When cross compiling LLVM on an arm64 machine to x86_64, CMake will produce universal binaries by default, causing link errors. Explicitly set CMAKE_OSX_ARCHITECTURES to the one single target architecture.
When cross compiling rustc with `llvm.clang = true`, CLANG_TABLEGEN has to be set to the host clang-tblgen executable to build clang.
@bors r- @topjohnwu can we please merge the existing changes before you add more? You can make a new PR if you want to get a review before this one is merged. |
@jyn514 sure, I'll split the 3rd commit into its own PR |
@bors r+ |
📌 Commit 600026a has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (73443a0): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
CMAKE_OSX_ARCHITECTURES
to the one single target architecture so that the executables and libraries will be single architecture.llvm.clang = true
,CLANG_TABLEGEN
has to be set to the hostclang-tblgen
executable to build clang.