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

Set CMAKE_SYSTEM_NAME for Linux targets #109170

Merged
merged 1 commit into from
Mar 20, 2023
Merged

Conversation

eggyal
Copy link
Contributor

@eggyal eggyal commented Mar 15, 2023

When bootstrap compiles native dependencies like LLVM, it should set CMAKE_SYSTEM_NAME for the target system; otherwise cmake may not identify that it is cross-compiling.

In particular, when building a Linux rustc on a macOS host, cmake was including -isysroot /path/to/macOS.sdk options that caused things to break. By setting CMAKE_SYSTEM_NAME=Linux when building for Linux targets, the macOS SDK is no longer passed as sysroot to the compiler.

r? bootstrap

When bootstrap compiles native dependencies like LLVM, it should set
CMAKE_SYSTEM_NAME for the target system; otherwise cmake may not
identify that it is cross-compiling.

In particular, when building a Linux rustc on a macOS host, cmake was
including `-isysroot /path/to/macOS.sdk` options that caused things to
break.  By setting `CMAKE_SYSTEM_NAME=Linux` when building for Linux
targets, the macOS SDK is no longer passed as sysroot to the compiler.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 15, 2023
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 18, 2023

📌 Commit d10b113 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 20, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#109170 (Set `CMAKE_SYSTEM_NAME` for Linux targets)
 - rust-lang#109266 (rustdoc: Correctly merge import's and its target's docs in one more case)
 - rust-lang#109267 (Add tests for configure.py)
 - rust-lang#109273 (Make `slice::is_sorted_by` implementation nicer)
 - rust-lang#109277 (Fix generics_of for impl's RPITIT synthesized associated type)
 - rust-lang#109307 (Ignore `Inlined` spans when computing caller location.)
 - rust-lang#109364 (Only expect a GAT const param for `type_of` of GAT const arg)
 - rust-lang#109365 (Update mdbook)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 96d5dd6 into rust-lang:master Mar 20, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 20, 2023
@eggyal eggyal deleted the xc-linux-cmake branch March 21, 2023 09:51
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 26, 2023
…e-system-name, r=ozkanonur

Define CMAKE_SYSTEM_NAME on a cross build targeting DragonFly.

Without `CMAKE_SYSTEM_NAME` set to the target  a cross compile will generally fail.  Related to rust-lang#109170.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants