[rust-dev] Issues linking a static Rust library

Tahia Khan tahia.khan at gmail.com
Tue Oct 7 19:56:32 PDT 2014

Thanks so much for the responses, they were very helpful! I ended up
manually working with the archive with ar commands (never knew about that
tool, thanks Ilya!) to get rid of non-object files and then suppressing
compiler errors about unresolved symbols (symbols that were specific to
rust I think, eg r-morestack-moretack.o) in the XCode linker with
"-undefined warning" flag. A bit hacky, but good enough for my purposes!

As for how these non-object files are used in static libraries.. from what
I can gather after researching the file types I encountered, looks like
they are used by LLVM for link time optimization.


On Tue, Oct 7, 2014 at 6:43 PM, comex <comexk at gmail.com> wrote:

> On Tue, Oct 7, 2014 at 4:03 PM, Tahia Khan <tahia.khan at gmail.com> wrote:
> > Does anyone know if there's some way to exclude these non-object files
> in a
> > staticlib/rlib? Or if there's some other way to avoid this build issue
> with
> > the XCode linker?
> Does Xcode's linker command line contain -force_load or -all_load?  If
> I'm reading the ld64 source code correctly, it'll only try to load all
> the files as objects when those flags are set.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20141007/9d6e4f35/attachment.html>

More information about the Rust-dev mailing list