Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package cargo-auditable for openSUSE:Factory
checked in at 2026-10-10 14:58:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cargo-auditable (Old)
and /work/SRC/openSUSE:Factory/.cargo-auditable.new.3698736 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cargo-auditable"
Sat Oct 10 14:58:12 2026 rev:12 rq:1383640 version:0.7.7~0
Changes:
--------
--- /work/SRC/openSUSE:Factory/cargo-auditable/cargo-auditable.changes
2026-09-16 17:41:07.736007059 +0200
+++
/work/SRC/openSUSE:Factory/.cargo-auditable.new.3698736/cargo-auditable.changes
2026-10-10 14:58:46.397457544 +0200
@@ -1,0 +2,12 @@
+Fri Oct 09 03:44:27 UTC 2026 - [email protected]
+
+- Update to version 0.7.7~0:
+ * Bump version
+ * Populate changelog
+ * Avoid obscure slice operation, use find_map instead
+ * Wire up detection of default linker flavor from the target platform JSON
+ * Add a function to query linker flavor from rustc where possible
+ * Add tests for linker flavor flag parsing
+ * Honor linker flavor flag
+
+-------------------------------------------------------------------
Old:
----
cargo-auditable-0.7.6~0.tar.zst
New:
----
cargo-auditable-0.7.7~0.tar.zst
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cargo-auditable.spec ++++++
--- /var/tmp/diff_new_pack.3D005I/_old 2026-10-10 14:58:47.910520847 +0200
+++ /var/tmp/diff_new_pack.3D005I/_new 2026-10-10 14:58:47.912520931 +0200
@@ -21,7 +21,7 @@
%define __cargo_common_opts %{?_smp_mflags}
Name: cargo-auditable
-Version: 0.7.6~0
+Version: 0.7.7~0
Release: 0
Summary: A tool to embed auditing information in ELF sections of rust
binaries
# If you know the license, put it's SPDX string here.
++++++ _service ++++++
--- /var/tmp/diff_new_pack.3D005I/_old 2026-10-10 14:58:47.943522228 +0200
+++ /var/tmp/diff_new_pack.3D005I/_new 2026-10-10 14:58:47.946522353 +0200
@@ -3,7 +3,7 @@
<param
name="url">https://github.com/rust-secure-code/cargo-auditable.git</param>
<param name="versionformat">@PARENT_TAG@~@TAG_OFFSET@</param>
<param name="scm">git</param>
- <param name="revision">v0.7.6</param>
+ <param name="revision">v0.7.7</param>
<param name="match-tag">v*</param>
<param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param>
<param name="versionrewrite-replacement">\1</param>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.3D005I/_old 2026-10-10 14:58:47.967523232 +0200
+++ /var/tmp/diff_new_pack.3D005I/_new 2026-10-10 14:58:47.969523316 +0200
@@ -1,6 +1,6 @@
<servicedata>
<service name="tar_scm">
<param
name="url">https://github.com/rust-secure-code/cargo-auditable.git</param>
- <param
name="changesrevision">fb744c1a27950229403054d3c950ca3fe36b78d4</param></service></servicedata>
+ <param
name="changesrevision">3d3bb574f97dc09a264cfc666ec5d40790f6b3ba</param></service></servicedata>
(No newline at EOF)
++++++ cargo-auditable-0.7.6~0.tar.zst -> cargo-auditable-0.7.7~0.tar.zst ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cargo-auditable-0.7.6~0/Cargo.lock
new/cargo-auditable-0.7.7~0/Cargo.lock
--- old/cargo-auditable-0.7.6~0/Cargo.lock 2026-09-13 17:59:28.000000000
+0200
+++ new/cargo-auditable-0.7.7~0/Cargo.lock 2026-10-02 14:59:47.000000000
+0200
@@ -116,7 +116,7 @@
[[package]]
name = "cargo-auditable"
-version = "0.7.6"
+version = "0.7.7"
dependencies = [
"auditable-info",
"auditable-serde",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cargo-auditable-0.7.6~0/cargo-auditable/CHANGELOG.md
new/cargo-auditable-0.7.7~0/cargo-auditable/CHANGELOG.md
--- old/cargo-auditable-0.7.6~0/cargo-auditable/CHANGELOG.md 2026-09-13
17:59:28.000000000 +0200
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/CHANGELOG.md 2026-10-02
14:59:47.000000000 +0200
@@ -5,6 +5,16 @@
The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).
+## [0.7.7] - 2026-10-02
+
+### Added
+
+ - The default linker flavor for a platform is now quieried and respected.
This adds support for certain bare-metal targets such as
thumbv8m.main-none-eabi that use the linker directly, without a C compiler
wrapper.
+
+### Fixed
+
+ - The `-C linker-flavor` rustc flag is now respected. This fixed builds for
projects that explicitly override it.
+
## [0.7.6] - 2026-09-13
### Fixed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cargo-auditable-0.7.6~0/cargo-auditable/Cargo.toml
new/cargo-auditable-0.7.7~0/cargo-auditable/Cargo.toml
--- old/cargo-auditable-0.7.6~0/cargo-auditable/Cargo.toml 2026-09-13
17:59:28.000000000 +0200
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/Cargo.toml 2026-10-02
14:59:47.000000000 +0200
@@ -1,6 +1,6 @@
[package]
name = "cargo-auditable"
-version = "0.7.6"
+version = "0.7.7"
edition = "2021"
authors = ["Sergey \"Shnatsel\" Davidoff <[email protected]>"]
license = "MIT OR Apache-2.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cargo-auditable-0.7.6~0/cargo-auditable/src/main.rs
new/cargo-auditable-0.7.7~0/cargo-auditable/src/main.rs
--- old/cargo-auditable-0.7.6~0/cargo-auditable/src/main.rs 2026-09-13
17:59:28.000000000 +0200
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/src/main.rs 2026-10-02
14:59:47.000000000 +0200
@@ -11,6 +11,7 @@
mod rustc_wrapper;
mod sbom_precursor;
mod target_info;
+mod target_json;
use std::process::exit;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cargo-auditable-0.7.6~0/cargo-auditable/src/rustc_arguments.rs
new/cargo-auditable-0.7.7~0/cargo-auditable/src/rustc_arguments.rs
--- old/cargo-auditable-0.7.6~0/cargo-auditable/src/rustc_arguments.rs
2026-09-13 17:59:28.000000000 +0200
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/src/rustc_arguments.rs
2026-10-02 14:59:47.000000000 +0200
@@ -37,30 +37,40 @@
result
}
+ /// This function can tell you if a bare linker is in use based on rustc
arguments.
+ /// Returns None if it wasn't explicitly specified in the arguments.
+ ///
/// Normally `rustc` uses a C compiler such as `cc` or `clang` as linker,
/// and arguments to the actual linker need to be passed prefixed with
`-Wl,`.
- /// But it is possible to configure Cargo and rustc to call a linker
directly,
- /// and the breakage it causes is subtle enough that people just roll with
it
- /// and complain when cargo-auditable doesn't support this configuration:
- /// <https://github.com/rust-secure-code/cargo-auditable/issues/202>
- ///
- /// This function can tell you if a bare linker is in use
- /// and whether you need to prepend `-Wl,` or not.
+ /// But it is possible to configure Cargo and rustc to call a linker
directly.
///
- /// Such setups are exceptionally rare and frankly it's a misconfiguration
- /// that will break more than just `cargo auditable`, but I am feeling
generous.
- pub fn bare_linker(&self) -> bool {
+ /// This function does **not** take the target defaults into account.
+ pub fn bare_linker(&self) -> Option<bool> {
+ let flavor_flag = self
+ .codegen
+ .iter()
+ .find(|s| s.starts_with("linker-flavor="));
let linker_flag = self.codegen.iter().find(|s|
s.starts_with("linker="));
- if let Some(linker_flag) = linker_flag {
+ // flavor flag takes priority
+ if let Some(flavor_flag) = flavor_flag {
+ let flavor = flavor_flag.strip_prefix("linker-flavor=").unwrap();
+ Some(linker_flavor_is_bare(flavor))
+ // if flavor is not passed explicitly, it is guessed from the linker
+ } else if let Some(linker_flag) = linker_flag {
let linker = linker_flag.strip_prefix("linker=").unwrap();
- if linker.ends_with("ld") {
- return true;
- }
+ Some(linker.ends_with("ld") || linker.ends_with("link"))
+ } else {
+ None
}
- false
}
}
+/// Checks if the specified linker flavor is bare (args passed directly to the
linker)
+/// or if we go through a C compiler first (and have to prefix linker args
with -Wl)
+pub fn linker_flavor_is_bare(flavor: &str) -> bool {
+ !flavor.ends_with("cc")
+}
+
impl RustcArgs {
// Split into its own function for unit testing
fn from_vec(raw_args: Vec<OsString>) -> Result<RustcArgs,
pico_args::Error> {
@@ -190,7 +200,53 @@
let raw_rustc_args = vec!["-C", "linker=rust-lld"];
let raw_rustc_args: Vec<OsString> = raw_rustc_args.into_iter().map(|s|
s.into()).collect();
let args = RustcArgs::from_vec(raw_rustc_args).unwrap();
- assert!(args.bare_linker());
+ assert!(args.bare_linker().unwrap());
+ }
+
+ #[test]
+ fn detect_bare_linker_from_flavor() {
+ let cases = [
+ ("gcc", false),
+ ("gnu-cc", false),
+ ("gnu-lld-cc", false),
+ ("darwin-cc", false),
+ ("darwin-lld-cc", false),
+ ("wasm-lld-cc", false),
+ ("unix-cc", false),
+ ("ld", true),
+ ("ld.lld", true),
+ ("ld64.lld", true),
+ ("lld-link", true),
+ ("wasm-ld", true),
+ ("msvc", true),
+ ("gnu", true),
+ ("gnu-lld", true),
+ ("darwin", true),
+ ("darwin-lld", true),
+ ("wasm-lld", true),
+ ("unix", true),
+ ("msvc-lld", true),
+ ("bpf", true),
+ ("llbc", true),
+ ("ptx", true),
+ ];
+ for (flavor, expected) in cases {
+ // Both joined and separate forms of -C must behave the same way.
+ for raw_args in [
+ vec![OsString::from(format!("-Clinker-flavor={flavor}"))],
+ vec!["-C".into(), format!("linker-flavor={flavor}").into()],
+ ] {
+ let args = RustcArgs::from_vec(raw_args).unwrap();
+ assert_eq!(args.bare_linker(), Some(expected), "flavor:
{flavor}");
+ }
+ }
+ }
+
+ #[test]
+ fn bare_linker_unspecified() {
+ let raw_args = vec!["-C".into(), "link-arg=-fuse-ld=lld".into()];
+ let args = RustcArgs::from_vec(raw_args).unwrap();
+ assert_eq!(args.bare_linker(), None);
}
#[test]
@@ -207,6 +263,6 @@
assert_eq!(args.codegen, expected);
- assert!(!args.bare_linker());
+ assert!(!args.bare_linker().unwrap());
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cargo-auditable-0.7.6~0/cargo-auditable/src/rustc_wrapper.rs
new/cargo-auditable-0.7.7~0/cargo-auditable/src/rustc_wrapper.rs
--- old/cargo-auditable-0.7.6~0/cargo-auditable/src/rustc_wrapper.rs
2026-09-13 17:59:28.000000000 +0200
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/src/rustc_wrapper.rs
2026-10-02 14:59:47.000000000 +0200
@@ -7,12 +7,11 @@
use crate::{
binary_file, collect_audit_data,
platform_detection::{is_32bit_x86, is_apple, is_msvc, is_wasm},
- rustc_arguments::{self, should_embed_audit_data},
- target_info,
+ rustc_arguments::{self, linker_flavor_is_bare, should_embed_audit_data,
RustcArgs},
+ target_info::{self, rustc_host_target_triple},
+ target_json::rustc_target_json,
};
-use std::io::BufRead;
-
pub fn main(rustc_path: &OsStr) {
let mut command = match rustc_command_with_audit_data(rustc_path) {
Some(cmd) => cmd,
@@ -46,18 +45,14 @@
command
}
-/// Returns the default target triple for the rustc we're running
-fn rustc_host_target_triple(rustc_path: &OsStr) -> String {
- Command::new(rustc_path)
- .arg("-vV")
- .output()
- .expect("Failed to invoke rustc! Is it in your $PATH?")
- .stdout
- .lines()
- .map(|l| l.unwrap())
- .find(|l| l.starts_with("host: "))
- .map(|l| l[6..].to_string())
- .expect("Failed to parse rustc output to determine the current
platform. Please report this bug!")
+fn bare_linker(rustc_path: &OsStr, target_triple: &str, args: RustcArgs) ->
bool {
+ if let Some(explicit_arg) = args.bare_linker() {
+ explicit_arg
+ } else if let Ok(target_json) = rustc_target_json(rustc_path,
target_triple) {
+ linker_flavor_is_bare(&target_json.linker_flavor)
+ } else {
+ false // bare linker configurations are rare
+ }
}
fn rustc_command_with_audit_data(rustc_path: &OsStr) -> Option<Command> {
@@ -127,7 +122,7 @@
command.arg(linker_command);
// Prevent the symbol from being removed as unused by the linker
if is_apple(&target_info) {
- if args.bare_linker() {
+ if bare_linker(rustc_path, &target_triple, args) {
command.arg("-Clink-arg=-u");
command.arg("-Clink-arg=_AUDITABLE_VERSION_INFO");
} else {
@@ -148,7 +143,7 @@
// Unrecognized platform, assume it to be unix-like.
// Use POSIX `-u` instead of GNU `--undefined=` for broad
compatibility
// (e.g. zig rejects the GNU form).
- if args.bare_linker() {
+ if bare_linker(rustc_path, &target_triple, args) {
command.arg("-Clink-arg=-u");
command.arg("-Clink-arg=AUDITABLE_VERSION_INFO");
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cargo-auditable-0.7.6~0/cargo-auditable/src/target_info.rs
new/cargo-auditable-0.7.7~0/cargo-auditable/src/target_info.rs
--- old/cargo-auditable-0.7.6~0/cargo-auditable/src/target_info.rs
2026-09-13 17:59:28.000000000 +0200
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/src/target_info.rs
2026-10-02 14:59:47.000000000 +0200
@@ -1,10 +1,10 @@
-use std::{ffi::OsStr, io::BufRead};
+use std::{ffi::OsStr, io::BufRead, process::Command};
pub type RustcTargetInfo = std::collections::HashMap<String, String>;
pub fn rustc_target_info(rustc_path: &OsStr, target_triple: &str) ->
RustcTargetInfo {
// this is hand-rolled because the relevant piece of Cargo is hideously
complex for some reason
- parse_rustc_target_info(&std::process::Command::new(rustc_path)
+ parse_rustc_target_info(&Command::new(rustc_path)
.arg("--print=cfg")
.arg(format!("--target={target_triple}")) //not being parsed by the
shell, so not a vulnerability
.output()
@@ -35,6 +35,19 @@
.collect()
}
+/// Returns the default target triple for the rustc we're running
+pub fn rustc_host_target_triple(rustc_path: &OsStr) -> String {
+ Command::new(rustc_path)
+ .arg("-vV")
+ .output()
+ .expect("Failed to invoke rustc! Is it in your $PATH?")
+ .stdout
+ .lines()
+ .map(|l| l.unwrap())
+ .find_map(|l| l.strip_prefix("host: ").map(str::to_owned))
+ .expect("Failed to parse rustc output to determine the current
platform. Please report this bug!")
+}
+
#[cfg(test)]
mod tests {
use super::*;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cargo-auditable-0.7.6~0/cargo-auditable/src/target_json.rs
new/cargo-auditable-0.7.7~0/cargo-auditable/src/target_json.rs
--- old/cargo-auditable-0.7.6~0/cargo-auditable/src/target_json.rs
1970-01-01 01:00:00.000000000 +0100
+++ new/cargo-auditable-0.7.7~0/cargo-auditable/src/target_json.rs
2026-10-02 14:59:47.000000000 +0200
@@ -0,0 +1,66 @@
+use std::{error::Error, ffi::OsStr, process::Command};
+
+use serde::Deserialize;
+
+#[derive(Debug, Deserialize)]
+pub struct RustcTargetJson {
+ #[serde(rename = "linker-flavor")]
+ pub linker_flavor: String,
+}
+
+/// Queries target defaults, without applying command-line linker overrides.
+///
+/// This function relies on nightly-only rustc functionality and may break.
+/// This kind of linker target querying is really only needed for obscure
+/// embedded platforms, and is not essential to the core functionality.
+pub fn rustc_target_json(
+ rustc_path: &OsStr,
+ target_triple: &str,
+) -> Result<RustcTargetJson, Box<dyn Error>> {
+ let output = Command::new(rustc_path)
+ // Enable this unstable query only for the child process, including on
stable rustc.
+ .env("RUSTC_BOOTSTRAP", "1")
+ .args(["-Z", "unstable-options", "--print", "target-spec-json"])
+ .arg(format!("--target={target_triple}")) //not being parsed by the
shell, so not a vulnerability
+ .output()
+ .map_err(|error| {
+ format!("Failed to invoke rustc to get target-spec-json for
'{target_triple}': {error}")
+ })?;
+
+ if !output.status.success() {
+ return Err(format!(
+ "rustc returned an error when asked for target-spec-json for
'{target_triple}' ({}): {}",
+ output.status,
+ String::from_utf8_lossy(&output.stderr)
+ )
+ .into());
+ }
+
+ serde_json::from_slice(&output.stdout).map_err(|error| {
+ format!("Failed to parse rustc target specification for
'{target_triple}': {error}").into()
+ })
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn query_linker_flavor() {
+ let rustc = std::env::var_os("RUSTC").unwrap_or_else(||
"rustc".into());
+ for (target, expected_flavors) in [
+ (
+ "x86_64-unknown-linux-gnu",
+ &["gcc", "gnu-cc", "gnu-lld-cc"][..],
+ ),
+ ("thumbv7em-none-eabihf", &["ld.lld", "gnu-lld"][..]),
+ ] {
+ let spec = rustc_target_json(&rustc, target).unwrap();
+ assert!(
+ expected_flavors.contains(&spec.linker_flavor.as_str()),
+ "unexpected linker flavor for {target}: {}",
+ spec.linker_flavor
+ );
+ }
+ }
+}
++++++ cargo-auditable.obsinfo ++++++
--- /var/tmp/diff_new_pack.3D005I/_old 2026-10-10 14:58:48.114529382 +0200
+++ /var/tmp/diff_new_pack.3D005I/_new 2026-10-10 14:58:48.117529508 +0200
@@ -1,5 +1,5 @@
name: cargo-auditable
-version: 0.7.6~0
-mtime: 1789315168
-commit: fb744c1a27950229403054d3c950ca3fe36b78d4
+version: 0.7.7~0
+mtime: 1790945987
+commit: 3d3bb574f97dc09a264cfc666ec5d40790f6b3ba
++++++ vendor.tar.zst ++++++
/work/SRC/openSUSE:Factory/cargo-auditable/vendor.tar.zst
/work/SRC/openSUSE:Factory/.cargo-auditable.new.3698736/vendor.tar.zst differ:
char 7, line 1