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

Add Trusty OS as tier 3 target #103895

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/aarch64_unknown_trusty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub fn target() -> Target {
max_atomic_width: Some(128),
panic_strategy: PanicStrategy::Abort,
os: "trusty".into(),
position_independent_executables: true,
randomPoison marked this conversation as resolved.
Show resolved Hide resolved
static_position_independent_executables: true,
crt_static_default: true,
crt_static_respected: false,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/armv7_unknown_trusty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub fn target() -> Target {
crt_static_respected: false,
relro_level: RelroLevel::Full,
panic_strategy: PanicStrategy::Abort,
position_independent_executables: true,
static_position_independent_executables: true,

..Default::default()
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_target/src/spec/tests/tests_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ impl Target {
assert!(self.executables);
}

// Check crt static stuff
if self.crt_static_default || self.crt_static_allows_dylibs {
// Check crt static stuff. Trusy only supports crt static and so does not enable
randomPoison marked this conversation as resolved.
Show resolved Hide resolved
// `crt_static_respected`.
if (self.crt_static_default || self.crt_static_allows_dylibs) && self.os != "trusty" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do other crt static only targets handle this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, it looks like the other targets that set crt_static_default: true are also setting crt_static_respected: true. I'm not sure what other targets do crt static-only the way we do for Trusty, but based on the consistency check they'd all have to be setting crt_static_respected: true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasm32-wasi is an example of a target that only supports static linking of libc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, and that target is using crt_static_respected: true. Should I switch back to doing it that way and revert the change to the test? That's how I originally had it, so I at least know that that configuration works for how we've been building Trusty.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess.

assert!(self.crt_static_respected);
}
}
Expand Down