Skip to content

Commit ce8fbe7

Browse files
committed
Auto merge of #106429 - djkoloski:add_vendor_to_fuchsia_target_triple, r=nagisa
Add vendor to Fuchsia's target triple Historically, Rust's Fuchsia targets have been labeled x86_64-fuchsia and aarch64-fuchsia. However, they should technically contain vendor information. This CL changes Fuchsia's target triples to include the "unknown" vendor since Clang now does normalization and handles all triple spellings. This was previously attempted in #90510, which was closed due to inactivity.
2 parents 0853d96 + f6ef039 commit ce8fbe7

File tree

14 files changed

+89
-89
lines changed

14 files changed

+89
-89
lines changed

compiler/rustc_target/src/spec/aarch64_fuchsia.rs compiler/rustc_target/src/spec/aarch64_unknown_fuchsia.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::spec::{SanitizerSet, Target, TargetOptions};
22

33
pub fn target() -> Target {
44
Target {
5-
llvm_target: "aarch64-fuchsia".into(),
5+
llvm_target: "aarch64-unknown-fuchsia".into(),
66
pointer_width: 64,
77
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
88
arch: "aarch64".into(),

compiler/rustc_target/src/spec/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1109,8 +1109,8 @@ supported_targets! {
11091109
("x86_64-apple-darwin", x86_64_apple_darwin),
11101110
("i686-apple-darwin", i686_apple_darwin),
11111111

1112-
("aarch64-fuchsia", aarch64_fuchsia),
1113-
("x86_64-fuchsia", x86_64_fuchsia),
1112+
("aarch64-unknown-fuchsia", aarch64_unknown_fuchsia),
1113+
("x86_64-unknown-fuchsia", x86_64_unknown_fuchsia),
11141114

11151115
("avr-unknown-gnu-atmega328", avr_unknown_gnu_atmega328),
11161116

compiler/rustc_target/src/spec/x86_64_fuchsia.rs compiler/rustc_target/src/spec/x86_64_unknown_fuchsia.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub fn target() -> Target {
88
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI;
99

1010
Target {
11-
llvm_target: "x86_64-fuchsia".into(),
11+
llvm_target: "x86_64-unknown-fuchsia".into(),
1212
pointer_width: 64,
1313
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
1414
.into(),

src/bootstrap/native.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1085,12 +1085,12 @@ fn supported_sanitizers(
10851085

10861086
match &*target.triple {
10871087
"aarch64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
1088-
"aarch64-fuchsia" => common_libs("fuchsia", "aarch64", &["asan"]),
1088+
"aarch64-unknown-fuchsia" => common_libs("fuchsia", "aarch64", &["asan"]),
10891089
"aarch64-unknown-linux-gnu" => {
10901090
common_libs("linux", "aarch64", &["asan", "lsan", "msan", "tsan", "hwasan"])
10911091
}
10921092
"x86_64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
1093-
"x86_64-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
1093+
"x86_64-unknown-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
10941094
"x86_64-unknown-freebsd" => common_libs("freebsd", "x86_64", &["asan", "msan", "tsan"]),
10951095
"x86_64-unknown-netbsd" => {
10961096
common_libs("netbsd", "x86_64", &["asan", "lsan", "msan", "tsan"])

src/ci/docker/host-x86_64/dist-various-2/Dockerfile

+18-18
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7
3030
RUN add-apt-repository -y 'deb https://apt.dilos.org/dilos dilos2 main'
3131

3232
ENV \
33-
AR_x86_64_fuchsia=x86_64-fuchsia-ar \
34-
CC_x86_64_fuchsia=x86_64-fuchsia-clang \
35-
CFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
36-
CXX_x86_64_fuchsia=x86_64-fuchsia-clang++ \
37-
CXXFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
38-
LDFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib" \
39-
AR_aarch64_fuchsia=aarch64-fuchsia-ar \
40-
CC_aarch64_fuchsia=aarch64-fuchsia-clang \
41-
CFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
42-
CXX_aarch64_fuchsia=aarch64-fuchsia-clang++ \
43-
CXXFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
44-
LDFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib" \
33+
AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \
34+
CC_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang \
35+
CFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
36+
CXX_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang++ \
37+
CXXFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
38+
LDFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib" \
39+
AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \
40+
CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \
41+
CFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
42+
CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \
43+
CXXFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
44+
LDFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib" \
4545
AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-ar \
4646
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-gcc \
4747
CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-g++ \
@@ -99,19 +99,19 @@ RUN /tmp/freebsd-toolchain.sh i686
9999
COPY scripts/sccache.sh /scripts/
100100
RUN sh /scripts/sccache.sh
101101

102-
ENV CARGO_TARGET_X86_64_FUCHSIA_AR /usr/local/bin/llvm-ar
103-
ENV CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS \
102+
ENV CARGO_TARGET_X86_64_UNKNOWN_FUCHSIA_AR /usr/local/bin/llvm-ar
103+
ENV CARGO_TARGET_X86_64_UNKNOWN_FUCHSIA_RUSTFLAGS \
104104
-C link-arg=--sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot \
105105
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot/lib \
106106
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib
107-
ENV CARGO_TARGET_AARCH64_FUCHSIA_AR /usr/local/bin/llvm-ar
108-
ENV CARGO_TARGET_AARCH64_FUCHSIA_RUSTFLAGS \
107+
ENV CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_AR /usr/local/bin/llvm-ar
108+
ENV CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_RUSTFLAGS \
109109
-C link-arg=--sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot \
110110
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot/lib \
111111
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib
112112

113-
ENV TARGETS=x86_64-fuchsia
114-
ENV TARGETS=$TARGETS,aarch64-fuchsia
113+
ENV TARGETS=x86_64-unknown-fuchsia
114+
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
115115
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
116116
ENV TARGETS=$TARGETS,wasm32-wasi
117117
ENV TARGETS=$TARGETS,sparcv9-sun-solaris

src/ci/docker/host-x86_64/dist-various-2/build-fuchsia-toolchain.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ install_clang() {
2929
# CFLAGS and CXXFLAGS env variables in main Dockerfile handle sysroot linking
3030
for arch in x86_64 aarch64; do
3131
for tool in clang clang++; do
32-
ln -s /usr/local/bin/${tool} /usr/local/bin/${arch}-fuchsia-${tool}
32+
ln -s /usr/local/bin/${tool} /usr/local/bin/${arch}-unknown-fuchsia-${tool}
3333
done
34-
ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-fuchsia-ar
34+
ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-unknown-fuchsia-ar
3535
done
3636

3737
popd > /dev/null

src/ci/docker/scripts/fuchsia-test-runner.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The Rust toolchain test runner for Fuchsia.
55
66
For instructions on running the compiler test suite, see
7-
https://doc.rust-lang.org/stable/rustc/platform-support/fuchsia.html#aarch64-fuchsia-and-x86_64-fuchsia
7+
https://doc.rust-lang.org/stable/rustc/platform-support/fuchsia.html#aarch64-unknown-fuchsia-and-x86_64-unknown-fuchsia
88
"""
99

1010
import argparse
@@ -110,9 +110,9 @@ def repo_dir(self):
110110

111111
def rustlib_dir(self):
112112
if self.target_arch == "x64":
113-
return "x86_64-fuchsia"
113+
return "x86_64-unknown-fuchsia"
114114
if self.target_arch == "arm64":
115-
return "aarch64-fuchsia"
115+
return "aarch64-unknown-fuchsia"
116116
raise Exception(f"Unrecognized target architecture {self.target_arch}")
117117

118118
def libs_dir(self):

src/doc/rustc/src/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- [armv7-unknown-linux-uclibceabi](platform-support/armv7-unknown-linux-uclibceabi.md)
2727
- [armv7-unknown-linux-uclibceabihf](platform-support/armv7-unknown-linux-uclibceabihf.md)
2828
- [\*-android and \*-androideabi](platform-support/android.md)
29-
- [\*-fuchsia](platform-support/fuchsia.md)
29+
- [\*-unknown-fuchsia](platform-support/fuchsia.md)
3030
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
3131
- [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md)
3232
- [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md)

src/doc/rustc/src/platform-support.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ target | std | notes
124124
-------|:---:|-------
125125
`aarch64-apple-ios` | ✓ | ARM64 iOS
126126
[`aarch64-apple-ios-sim`](platform-support/aarch64-apple-ios-sim.md) | ✓ | Apple iOS Simulator on ARM64
127-
`aarch64-fuchsia` | ✓ | ARM64 Fuchsia
127+
`aarch64-unknown-fuchsia` | ✓ | ARM64 Fuchsia
128128
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
129129
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
130130
`aarch64-unknown-none` | * | Bare ARM64, hardfloat
@@ -177,7 +177,7 @@ target | std | notes
177177
`wasm32-wasi` | ✓ | WebAssembly with WASI
178178
`x86_64-apple-ios` | ✓ | 64-bit x86 iOS
179179
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
180-
`x86_64-fuchsia` | ✓ | 64-bit Fuchsia
180+
`x86_64-unknown-fuchsia` | ✓ | 64-bit Fuchsia
181181
[`x86_64-linux-android`](platform-support/android.md) | ✓ | 64-bit x86 Android
182182
`x86_64-pc-solaris` | ✓ | 64-bit Solaris 10/11, illumos
183183
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)

src/doc/rustc/src/platform-support/fuchsia.md

+47-47
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `aarch64-fuchsia` and `x86_64-fuchsia`
1+
# `aarch64-unknown-fuchsia` and `x86_64-unknown-fuchsia`
22

33
**Tier: 2**
44

@@ -67,7 +67,7 @@ This walkthrough will cover:
6767
1. Building a Fuchsia package.
6868
1. Publishing and running a Fuchsia package to a Fuchsia emulator.
6969

70-
For the purposes of this walkthrough, we will only target `x86_64-fuchsia`.
70+
For the purposes of this walkthrough, we will only target `x86_64-unknown-fuchsia`.
7171

7272
## Compiling a Rust binary targeting Fuchsia
7373

@@ -83,8 +83,8 @@ to handle the installation of Fuchsia targets for you. This can be done by issui
8383
the following commands:
8484

8585
```sh
86-
rustup target add x86_64-fuchsia
87-
rustup target add aarch64-fuchsia
86+
rustup target add x86_64-unknown-fuchsia
87+
rustup target add aarch64-unknown-fuchsia
8888
```
8989

9090
After installing our Fuchsia targets, we can now compile a Rust binary that targets
@@ -127,7 +127,7 @@ during compilation:
127127

128128
**`.cargo/config.toml`**
129129
```txt
130-
[target.x86_64-fuchsia]
130+
[target.x86_64-unknown-fuchsia]
131131
132132
rustflags = [
133133
"-Lnative=<SDK_PATH>/arch/x64/lib",
@@ -159,10 +159,10 @@ hello_fuchsia/
159159
Finally, we can build our rust binary as:
160160

161161
```sh
162-
cargo build --target x86_64-fuchsia
162+
cargo build --target x86_64-unknown-fuchsia
163163
```
164164

165-
Now we have a Rust binary at `target/x86_64-fuchsia/debug/hello_fuchsia`,
165+
Now we have a Rust binary at `target/x86_64-unknown-fuchsia/debug/hello_fuchsia`,
166166
targeting our desired Fuchsia target.
167167

168168
**Current directory structure**
@@ -171,7 +171,7 @@ hello_fuchsia/
171171
┣━ src/
172172
┃ ┗━ main.rs
173173
┣━ target/
174-
┃ ┗━ x86_64-fuchsia/
174+
┃ ┗━ x86_64-unknown-fuchsia/
175175
┃ ┗━ debug/
176176
┃ ┗━ hello_fuchsia
177177
┣━ Cargo.toml
@@ -193,19 +193,19 @@ configuration in `config.toml`:
193193

194194
```toml
195195
[build]
196-
target = ["<host_platform>", "aarch64-fuchsia", "x86_64-fuchsia"]
196+
target = ["<host_platform>", "aarch64-unknown-fuchsia", "x86_64-unknown-fuchsia"]
197197

198198
[rust]
199199
lld = true
200200

201201
[llvm]
202202
download-ci-llvm = false
203203

204-
[target.x86_64-fuchsia]
204+
[target.x86_64-unknown-fuchsia]
205205
cc = "clang"
206206
cxx = "clang++"
207207

208-
[target.aarch64-fuchsia]
208+
[target.aarch64-unknown-fuchsia]
209209
cc = "clang"
210210
cxx = "clang++"
211211
```
@@ -236,14 +236,14 @@ a script we name `config-env.sh`:
236236
# Configure this environment variable to be the path to the downloaded SDK
237237
export SDK_PATH="<SDK path goes here>"
238238

239-
export CFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
240-
export CXXFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
241-
export LDFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -L${SDK_PATH}/arch/arm64/lib"
242-
export CARGO_TARGET_AARCH64_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/arm64/sysroot -Lnative=${SDK_PATH}/arch/arm64/sysroot/lib -Lnative=${SDK_PATH}/arch/arm64/lib"
243-
export CFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
244-
export CXXFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
245-
export LDFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -L${SDK_PATH}/arch/x64/lib"
246-
export CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/x64/sysroot -Lnative=${SDK_PATH}/arch/x64/sysroot/lib -Lnative=${SDK_PATH}/arch/x64/lib"
239+
export CFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
240+
export CXXFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
241+
export LDFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -L${SDK_PATH}/arch/arm64/lib"
242+
export CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/arm64/sysroot -Lnative=${SDK_PATH}/arch/arm64/sysroot/lib -Lnative=${SDK_PATH}/arch/arm64/lib"
243+
export CFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
244+
export CXXFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
245+
export LDFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -L${SDK_PATH}/arch/x64/lib"
246+
export CARGO_TARGET_X86_64_UNKNOWN_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/x64/sysroot -Lnative=${SDK_PATH}/arch/x64/sysroot/lib -Lnative=${SDK_PATH}/arch/x64/lib"
247247
```
248248

249249
Finally, the Rust compiler can be built and installed:
@@ -288,7 +288,7 @@ hello_fuchsia/
288288
Using your freshly installed `rustc`, you can compile a binary for Fuchsia using
289289
the following options:
290290

291-
* `--target x86_64-fuchsia`/`--target aarch64-fuchsia`: Targets the Fuchsia
291+
* `--target x86_64-unknown-fuchsia`/`--target aarch64-unknown-fuchsia`: Targets the Fuchsia
292292
platform of your choice
293293
* `-Lnative ${SDK_PATH}/arch/${ARCH}/lib`: Link against Fuchsia libraries from
294294
the SDK
@@ -299,7 +299,7 @@ Putting it all together:
299299

300300
```sh
301301
# Configure these for the Fuchsia target of your choice
302-
TARGET_ARCH="<x86_64-fuchsia|aarch64-fuchsia>"
302+
TARGET_ARCH="<x86_64-unknown-fuchsia|aarch64-unknown-fuchsia>"
303303
ARCH="<x64|aarch64>"
304304

305305
rustc \
@@ -325,16 +325,16 @@ Before moving on, double check your directory structure:
325325
**Current directory structure**
326326
```txt
327327
hello_fuchsia/
328-
┣━ src/ (if using rustc)
329-
┃ ┗━ hello_fuchsia.rs ...
330-
┣━ bin/ ...
331-
┃ ┗━ hello_fuchsia ...
332-
┣━ src/ (if using cargo)
333-
┃ ┗━ main.rs ...
334-
┗━ target/ ...
335-
┗━ x86_64-fuchsia/ ...
336-
┗━ debug/ ...
337-
┗━ hello_fuchsia ...
328+
┣━ src/ (if using rustc)
329+
┃ ┗━ hello_fuchsia.rs ...
330+
┣━ bin/ ...
331+
┃ ┗━ hello_fuchsia ...
332+
┣━ src/ (if using cargo)
333+
┃ ┗━ main.rs ...
334+
┗━ target/ ...
335+
┗━ x86_64-unknown-fuchsia/ ...
336+
┗━ debug/ ...
337+
┗━ hello_fuchsia ...
338338
```
339339

340340
With our Rust binary built, we can move to creating a Fuchsia package.
@@ -371,7 +371,7 @@ package must contain one.
371371

372372
**`pkg/hello_fuchsia.manifest` if using cargo**
373373
```txt
374-
bin/hello_fuchsia=target/x86_64-fuchsia/debug/hello_fuchsia
374+
bin/hello_fuchsia=target/x86_64-unknown-fuchsia/debug/hello_fuchsia
375375
lib/ld.so.1=<SDK_PATH>/arch/x64/sysroot/dist/lib/ld.so.1
376376
lib/libfdio.so=<SDK_PATH>/arch/x64/dist/libfdio.so
377377
meta/package=pkg/meta/package
@@ -546,16 +546,16 @@ structure will look like:
546546
**Final directory structure**
547547
```txt
548548
hello_fuchsia/
549-
┣━ src/ (if using rustc)
550-
┃ ┗━ hello_fuchsia.rs ...
551-
┣━ bin/ ...
552-
┃ ┗━ hello_fuchsia ...
553-
┣━ src/ (if using cargo)
554-
┃ ┗━ main.rs ...
555-
┣━ target/ ...
556-
┃ ┗━ x86_64-fuchsia/ ...
557-
┃ ┗━ debug/ ...
558-
┃ ┗━ hello_fuchsia ...
549+
┣━ src/ (if using rustc)
550+
┃ ┗━ hello_fuchsia.rs ...
551+
┣━ bin/ ...
552+
┃ ┗━ hello_fuchsia ...
553+
┣━ src/ (if using cargo)
554+
┃ ┗━ main.rs ...
555+
┣━ target/ ...
556+
┃ ┗━ x86_64-unknown-fuchsia/ ...
557+
┃ ┗━ debug/ ...
558+
┃ ┗━ hello_fuchsia ...
559559
┗━ pkg/
560560
┣━ meta/
561561
┃ ┣━ package
@@ -644,8 +644,8 @@ Tests can be run in the same way as a regular binary.
644644

645645
* If using `cargo`, you can simply pass `test --no-run`
646646
to the `cargo` invocation and then repackage and rerun the Fuchsia package. From our previous example,
647-
this would look like `cargo test --target x86_64-fuchsia --no-run`, and moving the executable
648-
binary path found from the line `Executable unittests src/main.rs (target/x86_64-fuchsia/debug/deps/hello_fuchsia-<HASH>)`
647+
this would look like `cargo test --target x86_64-unknown-fuchsia --no-run`, and moving the executable
648+
binary path found from the line `Executable unittests src/main.rs (target/x86_64-unknown-fuchsia/debug/deps/hello_fuchsia-<HASH>)`
649649
into `pkg/hello_fuchsia.manifest`.
650650

651651
* If using the compiled `rustc`, you can simply pass `--test`
@@ -714,7 +714,7 @@ run the full `src/test/ui` test suite:
714714
--config config.toml \
715715
--stage=2 \
716716
test src/test/ui \
717-
--target x86_64-fuchsia \
717+
--target x86_64-unknown-fuchsia \
718718
--run=always --jobs 1 \
719719
--test-args --target-rustcflags \
720720
--test-args -L \
@@ -758,7 +758,7 @@ directory to launch `zxdb`:
758758
**In separate terminal**
759759
```sh
760760
${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \
761-
--symbol-path target/x86_64-fuchsia/debug
761+
--symbol-path target/x86_64-unknown-fuchsia/debug
762762
```
763763

764764
* `--symbol-path` gets required symbol paths, which are
@@ -854,7 +854,7 @@ source code:
854854

855855
```sh
856856
${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \
857-
--symbol-path target/x86_64-fuchsia/debug \
857+
--symbol-path target/x86_64-unknown-fuchsia/debug \
858858
--build-dir ${RUST_SRC_PATH}/rust \
859859
--build-dir ${FUCHSIA_SRC_PATH}/fuchsia/out/default
860860
```

src/doc/unstable-book/src/compiler-flags/sanitizer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ with runtime flag `ASAN_OPTIONS=detect_leaks=1` on macOS.
5050
AddressSanitizer is supported on the following targets:
5151

5252
* `aarch64-apple-darwin`
53-
* `aarch64-fuchsia`
53+
* `aarch64-unknown-fuchsia`
5454
* `aarch64-unknown-linux-gnu`
5555
* `x86_64-apple-darwin`
56-
* `x86_64-fuchsia`
56+
* `x86_64-unknown-fuchsia`
5757
* `x86_64-unknown-freebsd`
5858
* `x86_64-unknown-linux-gnu`
5959

0 commit comments

Comments
 (0)