From c049e9552502b50a75fa9f31824c9e264f81aaae Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 4 Mar 2026 17:52:10 +0000 Subject: [PATCH 1/2] Add bare linker tests for Windows --- .../tests/fixtures/bare_linker/.cargo/config.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cargo-auditable/tests/fixtures/bare_linker/.cargo/config.toml b/cargo-auditable/tests/fixtures/bare_linker/.cargo/config.toml index b7511fc..e970667 100644 --- a/cargo-auditable/tests/fixtures/bare_linker/.cargo/config.toml +++ b/cargo-auditable/tests/fixtures/bare_linker/.cargo/config.toml @@ -32,3 +32,15 @@ rustflags = ["-C", "target-feature=+crt-static"] linker = "rust-lld" rustflags = ["-C", "target-feature=+crt-static"] +# === Not included in the original Rayhunter example === + +# this tests for https://github.com/rust-lang/rust/issues/96498 +[target.i686-pc-windows-msvc] +linker = "rust-lld" + +# this Just Works so we might as well see if it keeps working +[target.x86_64-pc-windows-msvc] +linker = "rust-lld" + +# GNU targets generally don't work with bare linkers; not even rayhunter uses it there. +# So we're not testing windows-gnu or linux-gnu \ No newline at end of file From c0de6a67ebc0914a1afef3a90fd4cf706bb3504f Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Wed, 4 Mar 2026 17:56:17 +0000 Subject: [PATCH 2/2] Update comment --- cargo-auditable/tests/it.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cargo-auditable/tests/it.rs b/cargo-auditable/tests/it.rs index bf3a9ae..b30ce1a 100644 --- a/cargo-auditable/tests/it.rs +++ b/cargo-auditable/tests/it.rs @@ -596,9 +596,11 @@ fn test_bare_linker_inner(sbom: bool) { let cargo_toml = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/bare_linker/Cargo.toml"); // The motivating example is https://github.com/EFForg/rayhunter/blob/main/.cargo/config.toml - // and the config file fixture is based on that. - // There doesn't seem to be a way to build with a bare linker for GNU targets, only Apple and Musl, - // so this tests really only does anything on those. + // and the config file fixture is based on that, with some additions. + // + // The config file doesn't specify a bare linker for all targets; + // e.g. GNU doesn't seem to support using a bare linker at all. + // See the config file for the exact list of targets where this is tested. let config_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("tests/fixtures/bare_linker/.cargo/config.toml");