Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psm: allow manual opt out of #cfg[link("psm_s")] #95

Merged
merged 1 commit into from
Sep 1, 2024

Commits on Aug 27, 2024

  1. psm: allow manual opt out of #cfg[link("psm_s")]

    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>
    thoughtpolice committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    dc3e1ad View commit details
    Browse the repository at this point in the history