Skip to content

Commit 291be63

Browse files
authored
Rollup merge of rust-lang#101256 - andrewpollack:fuchsia-docs-adding, r=tmandry
Fixes/adjustments to Fuchsia doc walkthrough Small fixes/adjustments missed during rust-lang#100927
2 parents ac90ff3 + d8b572b commit 291be63

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

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

+18-10
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,20 @@ during compilation:
125125
[target.x86_64-fuchsia]
126126
127127
rustflags = [
128-
"-Lnative", "<SDK_PATH>/arch/x64/sysroot/lib",
129-
"-Lnative", "<SDK_PATH>/arch/x64/lib"
128+
"-Lnative=<SDK_PATH>/arch/x64/lib",
129+
"-Lnative=<SDK_PATH>/arch/x64/sysroot/lib"
130130
]
131131
```
132132

133133
*Note: Make sure to fill out `<SDK_PATH>` with the path to the downloaded [Fuchsia SDK].*
134134

135+
These options configure the following:
136+
137+
* `-Lnative=${SDK_PATH}/arch/${ARCH}/lib`: Link against Fuchsia libraries from
138+
the SDK
139+
* `-Lnative=${SDK_PATH}/arch/${ARCH}/sysroot/lib`: Link against Fuchsia kernel
140+
libraries from the SDK
141+
135142
In total, our new project will look like:
136143

137144
**Current directory structure**
@@ -368,6 +375,7 @@ language called CML. The Fuchsia devsite contains an [overview of CML] and a
368375
}
369376
```
370377

378+
**Current directory structure**
371379
```txt
372380
hello_fuchsia/
373381
┗━ pkg/
@@ -386,6 +394,9 @@ ${SDK_PATH}/tools/${ARCH}/cmc compile \
386394
-o pkg/meta/hello_fuchsia.cm
387395
```
388396

397+
*Note: `--includepath` tells the compiler where to look for `include`s from our CML.
398+
In our case, we're only using `syslog/client.shard.cml`.*
399+
389400
**Current directory structure**
390401
```txt
391402
hello_fuchsia/
@@ -397,19 +408,16 @@ hello_fuchsia/
397408
┗━ hello_fuchsia.cml
398409
```
399410

400-
*Note: `--includepath` tells the compiler where to look for `include`s from our CML.
401-
In our case, we're only using `syslog/client.shard.cml`.*
402-
403411
### Building a Fuchsia package
404412

405413
Next, we'll build a package manifest as defined by our manifest:
406414

407415
```sh
408416
${SDK_PATH}/tools/${ARCH}/pm \
409-
-o hello_fuchsia_manifest \
417+
-o pkg/hello_fuchsia_manifest \
410418
-m pkg/hello_fuchsia.manifest \
411419
build \
412-
-output-package-manifest hello_fuchsia_package_manifest
420+
-output-package-manifest pkg/hello_fuchsia_package_manifest
413421
```
414422

415423
This will produce `pkg/hello_fuchsia_manifest/` which is a package manifest we can
@@ -469,15 +477,15 @@ We can publish our new package to that repository with:
469477

470478
```sh
471479
${SDK_PATH}/tools/${ARCH}/pm publish \
472-
-repo repo \
473-
-lp -f <(echo "hello_fuchsia_package_manifest")
480+
-repo pkg/repo \
481+
-lp -f <(echo "pkg/hello_fuchsia_package_manifest")
474482
```
475483

476484
Then we can add the repository to `ffx`'s package server as `hello-fuchsia` using:
477485

478486
```sh
479487
${SDK_PATH}/tools/${ARCH}/ffx repository add-from-pm \
480-
repo \
488+
pkg/repo \
481489
-r hello-fuchsia
482490
```
483491

0 commit comments

Comments
 (0)