rust/mk
bors 87115fd001 auto merge of #13901 : alexcrichton/rust/facade, r=brson
This is the second step in implementing #13851. This PR cannot currently land until a snapshot exists with #13892, but I imagine that this review will take longer.

This PR refactors a large amount of functionality outside of the standard library into a new library, libcore. This new library has 0 dependencies (in theory). In practice, this library currently depends on these symbols being available:

* `rust_begin_unwind` and `rust_fail_bounds_check` - These are the two entry points of failure in libcore. The symbols are provided by libstd currently. In the future (see the bullets on #13851) this will be officially supported with nice error mesages. Additionally, there will only be one failure entry point once `std::fmt` migrates to libcore.
* `memcpy` - This is often generated by LLVM. This is also quite trivial to implement for any platform, so I'm not too worried about this.
* `memcmp` - This is required for comparing strings. This function is quite common *everywhere*, so I don't feel to bad about relying on a consumer of libcore to define it.
* `malloc` and `free` - This is quite unfortunate, and is a temporary stopgap until we deal with the `~` situation. More details can be found in the module `core::should_not_exist`
* `fmod` and `fmodf` - These exist because the `Rem` trait is defined in libcore, so the `Rem` implementation for floats must also be defined in libcore. I imagine that any platform using floating-point modulus will have these symbols anyway, and otherwise they will be optimized out.
* `fdim` and `fdimf` - Like `fmod`, these are from the `Signed` trait being defined in libcore. I don't expect this to be much of a problem

These dependencies all "Just Work" for now because libcore only exists as an rlib, not as a dylib.

The commits themselves are organized to show that the overall diff of this extraction is not all that large. Most modules were able to be moved with very few modifications. The primary module left out of this iteration is `std::fmt`. I plan on migrating the `fmt` module to libcore, but I chose to not do so at this time because it had implications on the `Writer` trait that I wanted to deal with in isolation. There are a few breaking changes in these commits, but they are fairly minor, and are all labeled with `[breaking-change]`.

The nastiest parts of this movement come up with `~[T]` and `~str` being language-defined types today. I believe that much of this nastiness will get better over time as we migrate towards `Vec<T>` and `Str` (or whatever the types will be named). There will likely always be some extension traits, but the situation won't be as bad as it is today.

Known deficiencies:

* rustdoc will get worse in terms of readability. This is the next issue I will tackle as part of #13851. If others think that the rustdoc change should happen first, I can also table this to fix rustdoc first.
* The compiler reveals that all these types are reexports via error messages like `core::option::Option`. This is filed as #13065, and I believe that issue would have a higher priority now. I do not currently plan on fixing that as part of #13851. If others believe that this issue should be fixed, I can also place it on the roadmap for #13851.

I recommend viewing these changes on a commit-by-commit basis. The overall change is likely too overwhelming to take in.
2014-05-07 11:06:45 -07:00
..
clean.mk mk: Don't rm 'dist' during clean, just its contents 2014-03-24 14:29:19 -07:00
crates.mk mk: Add libcore 2014-05-07 08:12:48 -07:00
ctags.mk Don't make tags for our dependencies and tests. 2013-11-16 13:44:52 +11:00
dist.mk rustdoc: Migrate from sundown to hoedown 2014-05-03 17:36:20 -07:00
docs.mk rustdoc: Fix inclusion of the new fonts 2014-05-03 02:09:29 -07:00
host.mk mk: Add libcore 2014-05-07 08:12:48 -07:00
install.mk Made 'make install' include libs for additional targets 2014-04-08 00:03:12 -07:00
llvm.mk llvm: Add an option to statically link libstdc++ 2014-04-17 11:39:51 -07:00
main.mk mk: Copy fewer libraries into the host artifacts 2014-04-25 00:31:29 -04:00
perf.mk support for GNU configure syntax 2013-10-29 16:22:08 -07:00
platform.mk Lower armhf target feature to v6. 2014-05-06 02:05:05 -04:00
prepare.mk mk: Change windows to install from stage2 2014-04-15 19:45:00 -07:00
reconfig.mk mk: Move most of Makefile.in to .mk files 2014-02-14 17:45:54 -08:00
rt.mk rustdoc: Migrate from sundown to hoedown 2014-05-03 17:36:20 -07:00
rustllvm.mk Remove VPATH usage in Makefiles 2014-02-02 10:59:14 -08:00
snap.mk support for GNU configure syntax 2013-10-29 16:22:08 -07:00
stage0.mk configure: Make rustlibdir non-configurable 2014-03-25 21:35:10 -07:00
target.mk llvm: Add an option to statically link libstdc++ 2014-04-17 11:39:51 -07:00
tests.mk auto merge of #13832 : alexcrichton/rust/cfail-full, r=brson 2014-05-07 08:11:52 -07:00
util.mk mk: Address review feedback 2014-02-14 19:17:50 -08:00