about summary refs log tree commit diff
path: root/src/liballoc_system
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-05-10 14:17:57 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-05-19 15:32:03 -0700
commit07d373f3d6e616058864afd963f6f7bb518249a4 (patch)
tree38c6c7587341326aa9a16201144211a66b55c71a /src/liballoc_system
parent9743c661b0e768997cf4af1c8da8d5838e1c2c2f (diff)
downloadrust-07d373f3d6e616058864afd963f6f7bb518249a4.tar.gz
rust-07d373f3d6e616058864afd963f6f7bb518249a4.zip
rustc: Add a new crate type, cdylib
This commit is an implementation of [RFC 1510] which adds a new crate type,
`cdylib`, to the compiler. This new crate type differs from the existing `dylib`
crate type in a few key ways:

* No metadata is present in the final artifact
* Symbol visibility rules are the same as executables, that is only reachable
  `extern` functions are visible symbols
* LTO is allowed
* All libraries are always linked statically

This commit is relatively simple by just plubming the compiler with another
crate type which takes different branches here and there. The only major change
is an implementation of the `Linker::export_symbols` function on Unix which now
actually does something. This helps restrict the public symbols from a cdylib on
Unix.

With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB,
which is some nice size savings!

[RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510

Closes #33132
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions