Commit d0c34d5
psm: allow manual opt out of
Currenty, when using the `asm` configuration, the `lib.rs` file will manually
add a `link("psm_s")` attribute to the build causing a flag like `-lpsm_s`
to appear on the link line. `psm_s` is the library of assembly code, built by
`build.rs` in Cargo projects.
However, when using Cargo packages with build systems like Buck2, we have to
manually replace the `build.rs` script, and build the bits of C/assembly code
that come with `psm` and `stacker` as a separate build item (an actual library),
then link them into the Rust libraries.
The name of the library often can't be easily made identical to `psm_s` as
desired by the `link()` call, meaning that just blindly compiling this crate
causes an inevitable linking failure. But we're building the code and explicitly
linking the library anyway, removing the need for this `#[link]` clause.
Therefore, introduce a new `link_asm` cfg option to give "expert" users the
ability to link in code manually. This is always enabled by the Cargo build for
`asm`-compatible targets, but Buck users can leave it off.
Signed-off-by: Austin Seipp <aseipp@pobox.com>#cfg[link("psm_s")]
1 parent 9f8cf8f commit d0c34d5
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments