Closed
Description
Right now, since we're linking with the C compiler (#11937) we're giving all Rust code access to libc. I think the compiler itself should not force linking to libc (and anything else cc
links us to by default). Instead either std
or the potential libc
crate (#11828) should be responsible for the libc link.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
thestinger commentedon Jan 31, 2014
I don't think we want a libc crate/module in the long-term. It should come from libclang so it works on more than the hard-wired glibc ABI, etc. Since code gets inlined, I think we do have to link everything to the libraries we use. Passing
--as-needed
to the linker will strip any unnecessary dependencies.alexcrichton commentedon Feb 16, 2014
Closed by #12205, with
-nodefaultlibs
gcc will not specify any libraries by default, we have to supply all of them. We now have#[link(name = "c")]
for linux required in libstd.