From 20dae470eb56149d924273abc43e5172fd7b5b7d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 24 Apr 2024 14:23:19 -0700 Subject: [PATCH 1/3] Crater-test adding target_family = linux --- compiler/rustc_target/src/spec/base/android.rs | 2 ++ compiler/rustc_target/src/spec/base/linux.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/base/android.rs b/compiler/rustc_target/src/spec/base/android.rs index 5320f1b4bbbea..c92ed0ddae968 100644 --- a/compiler/rustc_target/src/spec/base/android.rs +++ b/compiler/rustc_target/src/spec/base/android.rs @@ -3,6 +3,8 @@ use crate::spec::{base, SanitizerSet, TargetOptions, TlsModel}; pub fn opts() -> TargetOptions { let mut base = base::linux::opts(); base.os = "android".into(); + // listing families in different orders seems most chaotic. :^) + base.families = cvs!["unix, linux"]; base.is_like_android = true; base.default_dwarf_version = 2; base.tls_model = TlsModel::Emulated; diff --git a/compiler/rustc_target/src/spec/base/linux.rs b/compiler/rustc_target/src/spec/base/linux.rs index df8e848124a9b..4567a0be8942a 100644 --- a/compiler/rustc_target/src/spec/base/linux.rs +++ b/compiler/rustc_target/src/spec/base/linux.rs @@ -5,7 +5,7 @@ pub fn opts() -> TargetOptions { TargetOptions { os: "linux".into(), dynamic_linking: true, - families: cvs!["unix"], + families: cvs!["linux", "unix"], has_rpath: true, position_independent_executables: true, relro_level: RelroLevel::Full, From bfe956eec1de89beb1150457d634af44822d4e00 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 24 Apr 2024 14:25:50 -0700 Subject: [PATCH 2/3] Add target_family = apple for good measure --- compiler/rustc_target/src/spec/base/apple/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/base/apple/mod.rs b/compiler/rustc_target/src/spec/base/apple/mod.rs index d667bad44e3b7..8eff7fcf74557 100644 --- a/compiler/rustc_target/src/spec/base/apple/mod.rs +++ b/compiler/rustc_target/src/spec/base/apple/mod.rs @@ -150,7 +150,7 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions { function_sections: false, dynamic_linking: true, pre_link_args: pre_link_args(os, arch, abi), - families: cvs!["unix"], + families: cvs!["apple", "unix"], is_like_osx: true, // LLVM notes that macOS 10.11+ and iOS 9+ default // to v4, so we do the same. From e6199bd925a37ba44a4be35d09981e8813433d4a Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 24 Apr 2024 15:46:22 -0700 Subject: [PATCH 3/3] Fixup missing import --- compiler/rustc_target/src/spec/base/android.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_target/src/spec/base/android.rs b/compiler/rustc_target/src/spec/base/android.rs index c92ed0ddae968..bb491f3c067ef 100644 --- a/compiler/rustc_target/src/spec/base/android.rs +++ b/compiler/rustc_target/src/spec/base/android.rs @@ -1,5 +1,7 @@ use crate::spec::{base, SanitizerSet, TargetOptions, TlsModel}; +use crate::spec::cvs; + pub fn opts() -> TargetOptions { let mut base = base::linux::opts(); base.os = "android".into();