On the issue of a Rust program depending on a static library generated by another Rust program

⚓ rust    📅 2025-05-21    👤 surdeus    👁️ 4      

surdeus

Warning

This post was published 40 days ago. The information described in this article may have changed.

A Rust program depends on a static library libfoo.a, but this libfoo.a is actually also written and generated in Rust. When I use nm libfoo.a, I see that it exports all symbols, including those from libstd (e.g., std::*) and symbols from its own dependencies (e.g., tokio::*). I want to know what will happen when the Rust program links against this libfoo.a again. Will the symbols from std and tokio conflict? Or could this lead to undefined behavior (UB)?

4 posts - 2 participants

Read full topic

🏷️ rust_feed