What if the final executable also wants to link against a slightly newer
version of libfoo.a?   I'm not even sure what ld would do then.   Complains
about duplicate symbols?  Picks one at random?

I think I'd rather have Rust object file along with a list of libraries
that will be needed for final linking.  This could be a companion text file
or maybe a command line option to rustc, which dumps this info from
metadata.
And if I really do want a monolithic library file, I can always create one
with ar, can't I?

Vadim

On Fri, Nov 15, 2013 at 12:12 PM, Alex Crichton <[email protected]> wrote:

> You would be required to specify that the native library would be static
> via
>
> #[link(name = "foo", static)]
> extern { ... }
>
> And then rustc would bundle libfoo.a with libmycomp.a. libmycomp.a
> would also include any upstream rust dependencies (libstd.a,
> libextra.a, etc.)
>
> On Fri, Nov 15, 2013 at 12:00 PM, Vadim <[email protected]> wrote:
> > So in the case of --staticlib, if my Rust library, libmycomp.a, depended
> on
> > non-Rust local native library, libfoo.a, would Rust then bundle all
> modules
> > from libfoo into libmycomp?   Or would it only do so for Rust libraries,
> > e.g. libstd.a?
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to