Skip to content
/ rust Public
forked from rust-lang/rust

Commit ac73454

Browse files
authored
Rollup merge of rust-lang#137836 - madsmtm:openwrt-target-vendor, r=jieyouxu
Set `target_vendor = "openwrt"` on `mips64-openwrt-linux-musl` OpenWRT is a Linux distribution for embedded network devices. The target name contains `openwrt`, so we should set `cfg(target_vendor = "openwrt")`. This is similar to what other Linux distributions do (the only one in-tree is `x86_64-unikraft-linux-musl`, but that sets `target_vendor = "unikraft"`). Motivation: To make correctly [parsing target names](rust-lang/cc-rs#1413) simpler. Fixes rust-lang#131165. CC target maintainer `@Itus-Shield`
2 parents d9a357e + c4d6426 commit ac73454

5 files changed

+5
-4
lines changed

compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
2323
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
2424
arch: "mips64".into(),
2525
options: TargetOptions {
26+
vendor: "openwrt".into(),
2627
abi: "abi64".into(),
2728
endian: Endian::Big,
2829
mcount: "_mcount".into(),

tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition value: `value`
1414
LL | #[cfg(target_vendor = "value")]
1515
| ^^^^^^^^^^^^^^^^^^^^^^^
1616
|
17-
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
17+
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `openwrt`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
1818
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
1919

2020
warning: unexpected `cfg` condition name: `feature`

tests/ui/check-cfg/exhaustive-names-values.feature.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ warning: unexpected `cfg` condition value: `value`
1515
LL | #[cfg(target_vendor = "value")]
1616
| ^^^^^^^^^^^^^^^^^^^^^^^
1717
|
18-
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
18+
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `openwrt`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
1919
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
2020

2121
warning: unexpected `cfg` condition value: `unk`

tests/ui/check-cfg/exhaustive-names-values.full.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ warning: unexpected `cfg` condition value: `value`
1515
LL | #[cfg(target_vendor = "value")]
1616
| ^^^^^^^^^^^^^^^^^^^^^^^
1717
|
18-
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
18+
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `openwrt`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
1919
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
2020

2121
warning: unexpected `cfg` condition value: `unk`

tests/ui/check-cfg/well-known-values.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
230230
LL | target_vendor = "_UNEXPECTED_VALUE",
231231
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232232
|
233-
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
233+
= note: expected values for `target_vendor` are: `amd`, `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `mti`, `nintendo`, `nvidia`, `openwrt`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
234234
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
235235

236236
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`

0 commit comments

Comments
 (0)