| # This is a shim Cargo.toml which serves as a proxy for building the standard |
| # library. The reason for this is a little subtle, as one might reasonably |
| # expect that we just `cargo build` the standard library itself. |
| # |
| # One of the output artifacts for the standard library is a dynamic library, and |
| # on platforms like OSX the name of the output artifact is actually encoded into |
| # the library itself (similar to a soname on Linux). When the library is linked |
| # against, this encoded name is what's literally looked for at runtime when the |
| # dynamic loader is probing for libraries. |
| # |
| # Cargo, however, by default will not mangle the output filename of the |
| # top-level target. If we were to run `cargo build` on libstd itself, we would |
| # generate a file `libstd.so`. When installing, however, this file is called |
| # something like `libstd-abcdef0123.so`. On OSX at least this causes a failure |
| # at runtime because the encoded "soname" is `libstd.so`, not what the file is |
| # actually called. |
| # |
| # By using this shim library to build the standard library by proxy we sidestep |
| # this problem. The standard library is built with mangled hex already in its |
| # name so there's nothing extra we need to do. |
| |
| [package] |
| name = "std_shim" |
| version = "0.1.0" |
| authors = ["The Rust Project Developers"] |
| |
| [lib] |
| name = "std_shim" |
| path = "lib.rs" |
| |
| [profile.release] |
| opt-level = 2 |
| [profile.bench] |
| opt-level = 2 |
| |
| # These options are controlled from our rustc wrapper script, so turn them off |
| # here and have them controlled elsewhere. |
| [profile.dev] |
| debug = false |
| debug-assertions = false |
| |
| [dependencies] |
| std = { path = "../../libstd" } |
| |
| # Reexport features from std |
| [features] |
| jemalloc = ["std/jemalloc"] |
| debug-jemalloc = ["std/debug-jemalloc"] |