summary refs log tree commit diff
path: root/mk/rt.mk
AgeCommit message (Collapse)AuthorLines
2014-10-02remove the uv_support codeDaniel Micay-2/+1
2014-10-01Remove libuv, gypAaron Turon-136/+1
This commit removes the libuv and gyp submodules, as well as all build infrastructure related to them. For more context, see the [runtime removal RFC](https://github.com/rust-lang/rfcs/pull/230) [breaking-change]
2014-09-22Copy GYP environment variables on iOSMatt Coffin-0/+3
2014-09-22Ensure that compiler environment is passed to gypMatt Coffin-0/+3
this only affects libuv
2014-09-14mk: Don't depend on src/jemalloc/VERSIONAlex Crichton-0/+4
This file is touched during the build process and will trigger more rebuilds than necessary. Closes #17183
2014-09-07enable jemalloc debugging in unoptimized buildsDaniel Micay-1/+1
The performance hit from these checks is significant, but unoptimized builds are already incredibly slow. Enabling these checks results in better test coverage since there are bots doing unoptimized builds, and the cost is relatively small in the context of an unoptimized build. This also allows using `JEMALLOC_FLAGS` to override the default configure flags.
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-1/+5
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-23mk: Remove extra whitespace before line continuation backslashesBirunthan Mohanathas-3/+3
2014-06-16alloc: Allow disabling jemallocAlex Crichton-0/+6
2014-06-16Potential fix for Win32 buildValerii Hiora-1/+0
It seems in one of rebases I’ve resolved conflicts wrong and left one redundant line, it is absent in current master and it might cause compilation failure by copying file into itself.
2014-06-12Platform configurationValerii Hiora-6/+43
FIXME: avoid using Xcode build and switch to a patched libuv
2014-06-12mk: Allow using a locally compiled libuv.aAlex Crichton-8/+19
Closes #5563
2014-06-12mk: Allow usage of a local jemalloc installAlex Crichton-2/+16
This adds a new configure option, --jemalloc-root, which will specify a location at which libjemalloc_pic.a must live. This library is then used for the build triple as the jemalloc library to link.
2014-06-06std: Extract librustrt out of libstdAlex Crichton-4/+5
As part of the libstd facade efforts, this commit extracts the runtime interface out of the standard library into a standalone crate, librustrt. This crate will provide the following services: * Definition of the rtio interface * Definition of the Runtime interface * Implementation of the Task structure * Implementation of task-local-data * Implementation of task failure via unwinding via libunwind * Implementation of runtime initialization and shutdown * Implementation of thread-local-storage for the local rust Task Notably, this crate avoids the following services: * Thread creation and destruction. The crate does not require the knowledge of an OS threading system, and as a result it seemed best to leave out the `rt::thread` module from librustrt. The librustrt module does depend on mutexes, however. * Implementation of backtraces. There is no inherent requirement for the runtime to be able to generate backtraces. As will be discussed later, this functionality continues to live in libstd rather than librustrt. As usual, a number of architectural changes were required to make this crate possible. Users of "stable" functionality will not be impacted by this change, but users of the `std::rt` module will likely note the changes. A list of architectural changes made is: * The stdout/stderr handles no longer live directly inside of the `Task` structure. This is a consequence of librustrt not knowing about `std::io`. These two handles are now stored inside of task-local-data. The handles were originally stored inside of the `Task` for perf reasons, and TLD is not currently as fast as it could be. For comparison, 100k prints goes from 59ms to 68ms (a 15% slowdown). This appeared to me to be an acceptable perf loss for the successful extraction of a librustrt crate. * The `rtio` module was forced to duplicate more functionality of `std::io`. As the module no longer depends on `std::io`, `rtio` now defines structures such as socket addresses, addrinfo fiddly bits, etc. The primary change made was that `rtio` now defines its own `IoError` type. This type is distinct from `std::io::IoError` in that it does not have an enum for what error occurred, but rather a platform-specific error code. The native and green libraries will be updated in later commits for this change, and the bulk of this effort was put behind updating the two libraries for this change (with `rtio`). * Printing a message on task failure (along with the backtrace) continues to live in libstd, not in librustrt. This is a consequence of the above decision to move the stdout/stderr handles to TLD rather than inside the `Task` itself. The unwinding API now supports registration of global callback functions which will be invoked when a task fails, allowing for libstd to register a function to print a message and a backtrace. The API for registering a callback is experimental and unsafe, as the ramifications of running code on unwinding is pretty hairy. * The `std::unstable::mutex` module has moved to `std::rt::mutex`. * The `std::unstable::sync` module has been moved to `std::rt::exclusive` and the type has been rewritten to not internally have an Arc and to have an RAII guard structure when locking. Old code should stop using `Exclusive` in favor of the primitives in `libsync`, but if necessary, old code should port to `Arc<Exclusive<T>>`. * The local heap has been stripped down to have fewer debugging options. None of these were tested, and none of these have been used in a very long time. [breaking-change]
2014-06-05mk: Move rust_test_helpers out of libstdAlex Crichton-2/+3
There's no need to distribute these ABI helpers for tests with the standard rust distribution they're only needed for our tests. Closes #2665
2014-05-15mk: Don't build jemalloc with -g3Alex Crichton-1/+1
By default, jemalloc is building itself with -g3 if the local compiler supports it. It looks like this is generating a good deal of debug info that windows isn't optimizing out (on the order of 18MB). Windows gcc/ld is also not optimizing this data away, causing hello world to be 18MB in size. There's no current real need for debugging jemalloc to a great extent, so this commit manually passes -g1 to override -g3 which jemalloc is using. This is confirmed to drop the size of executables on windows back to a more reasonable size (2.0MB, as they were before). Closes #14144
2014-05-11make sure jemalloc valgrind support is enabledDaniel Micay-0/+1
This requires pointing it at the valgrind headers we carry in-tree.
2014-05-11pass correct CFLAGS for jemallocDaniel Micay-1/+1
2014-05-10add back jemalloc to the treeDaniel Micay-4/+48
This adds a `std::rt::heap` module with a nice allocator API. It's a step towards fixing #13094 and is a starting point for working on a generic allocator trait. The revision used for the jemalloc submodule is the stable 3.6.0 release. Closes #11807
2014-05-03rustdoc: Migrate from sundown to hoedownAlex Crichton-10/+11
This primary fix brought on by this upgrade is the proper matching of the ``` and ~~~ doc blocks. This also moves hoedown to a git submodule rather than a bundled repository. Additionally, hoedown is stricter about code blocks, so this ended up fixing a lot of invalid code blocks (ending with " ```" instead of "```", or ending with "~~~~" instead of "~~~"). Closes #12776
2014-04-22Upgrade compiler-rtVadim Chugunov-2/+2
2014-03-27mk: Always touch libuv.aBrian Anderson-0/+1
libuv.a always looks out of date to the makefile, causing make to always descend into the libuv makefile, even when there's nothing to build.
2014-03-13Add basic backtrace functionalityAlex Crichton-0/+67
Whenever a failure happens, if a program is run with `RUST_LOG=std::rt::backtrace` a backtrace will be printed to the task's stderr handle. Stack traces are uncondtionally printed on double-failure and rtabort!(). This ended up having a nontrivial implementation, and here's some highlights of it: * We're bundling libbacktrace for everything but OSX and Windows * We use libgcc_s and its libunwind apis to get a backtrace of instruction pointers * On OSX we use dladdr() to go from an instruction pointer to a symbol * On unix that isn't OSX, we use libbacktrace to get symbols * Windows, as usual, has an entirely separate implementation Lots more fun details and comments can be found in the source itself. Closes #10128
2014-02-14Add MKFILE_DEPS to compiler-rt targetAlex Crichton-1/+1
Currently when you run `make -jN` it's likely that you'll remove compiler-rt and then it won't get cp'd back into the right place. I believe the reason for this is that the compiler-rt library target never got updated so make decided it never needed to copy the files back into place. The files were all there at the beginning of `make`, but then we may clean out the stage0 versions if we unzip the snapshot again.
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-2/+3
Two unfortunate allocations were wrapping a proc() in a proc() with GreenTask::build_start_wrapper, and then boxing this proc in a ~proc() inside of Context::new(). Both of these allocations were a direct result from two conditions: 1. The Context::new() function has a nice api of taking a procedure argument to start up a new context with. This inherently required an allocation by build_start_wrapper because extra code needed to be run around the edges of a user-provided proc() for a new task. 2. The initial bootstrap code only understood how to pass one argument to the next function. By modifying the assembly and entry points to understand more than one argument, more information is passed through in registers instead of allocating a pointer-sized context. This is sadly where I end up throwing mips under a bus because I have no idea what's going on in the mips context switching code and don't know how to modify it. Closes #7767 cc #11389
2014-02-11Build compiler-rt and link it to all crates, similarly to morestack.Vadim Chugunov-0/+31
2014-02-02Remove VPATH usage in MakefilesAlex Crichton-3/+5
This is just messing up all the doc dependencies because of such similar directory names and file names. Closes #11422
2014-01-26Move extra::flate to libflateAlex Crichton-2/+2
This is hopefully the beginning of the long-awaited dissolution of libextra. Using the newly created build infrastructure for building libraries, I decided to move the first module out of libextra. While not being a particularly meaty module in and of itself, the flate module is required by rustc and additionally has a native C dependency. I was able to very easily split out the C dependency from rustrt, update librustc, and magically everything gets installed to the right locations and built automatically. This is meant to be a proof-of-concept commit to how easy it is to remove modules from libextra now. I didn't put any effort into modernizing the interface of libflate or updating it other than to remove the one glob import it had.
2014-01-26Refactor the build system for easily adding cratesAlex Crichton-196/+122
Before this patch, if you wanted to add a crate to the build system you had to change about 100 lines across 8 separate makefiles. This is highly error prone and opaque to all but a few. This refactoring is targeted at consolidating this effort so adding a new crate adds one line in one file in a way that everyone can understand it.
2014-01-03Fix ARM unwinding.Vadim Chugunov-1/+1
2013-12-26Register new snapshotsAlex Crichton-1/+0
2013-12-24Stop using C++ exceptions for stack unwinding.Vadim Chugunov-10/+12
2013-12-22uv: Suppress a warning by using an absolute pathAlex Crichton-6/+17
Turns out libuv's build system doesn't like us telling them that the build directory is a relative location, as it always spits out a warning about a circular dependency being dropped. By using an absolute path, turns out the warnings isn't spit out, who knew? Closes #11067
2013-11-29Statically link librustrt to libstdAlex Crichton-4/+2
This commit alters the build process of the compiler to build a static librustrt.a instead of a dynamic version. This means that we can stop distributing librustrt as well as default linking against it in the compiler. This also means that if you attempt to build rust code without libstd, it will no longer work if there are any landing pads in play. The reason for this is that LLVM and rustc will emit calls to the various upcalls in librustrt used to manage exception handling. In theory we could split librustrt into librustrt and librustupcall. We would then distribute librustupcall and link to it for all programs using landing pads, but I would rather see just one librustrt artifact and simplify the build process. The major benefit of doing this is that building a static rust library for use in embedded situations all of a sudden just became a whole lot more feasible. Closes #3361
2013-11-22Remove sjlj stuff from rust_upcall and don't pass -Werror to libuv.Luqman Aden-2/+7
2013-11-22mk: Get rid of redundant LIBUV_FLAGS.Luqman Aden-36/+3
2013-11-22Fix up mingw64 target.Luqman Aden-16/+32
2013-11-18Move runtime files to C instead of C++Alex Crichton-11/+16
Explicitly have the only C++ portion of the runtime be one file with exception handling. All other runtime files must now live in C and be fully defined in C.
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-1/+0
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-10Another round of test fixes from previous commitsAlex Crichton-1/+1
2013-11-10Update to the latest libuvAlex Crichton-1/+1
At this time, also point the libuv submodule to the official repo instead of my own off to the side. cc #10246 Closes #10329
2013-11-06auto merge of #10227 : kud1ing/rust/ios, r=alexcrichtonbors-0/+7
2013-11-06Fixes for compilation to iOS:kud1ing-0/+7
- remove /usr/include from the include path since the iOS SDK provides the correct version - `_NSGetEnviron()` is private and not available on iOS - `.align` without an argument is not allowed with the Apple tools. 2^2 should be the default alignment - ignore error messages for XCode < 5 - pass include path to libuv
2013-11-05Move implementation for threads to RustDirkjan Bussink-1/+0
This binds to the appropriate pthreads_* and Windows specific functions and calls them from Rust. This allows for removal of the C++ support code for threads. Fixes #10162
2013-11-02Statically link libuv to librustuvAlex Crichton-5/+23
Similarly to the previous commit, libuv is only used by this library, so there's no need for it to be linked into librustrt and available to all crates by default.
2013-11-01Statically link sundown to librustdocAlex Crichton-10/+28
Closes #10103
2013-10-29support for GNU configure syntaxHeather-6/+5
2013-10-29Move rust's uv implementation to its own crateAlex Crichton-1/+1
There are a few reasons that this is a desirable move to take: 1. Proof of concept that a third party event loop is possible 2. Clear separation of responsibility between rt::io and the uv-backend 3. Enforce in the future that the event loop is "pluggable" and replacable Here's a quick summary of the points of this pull request which make this possible: * Two new lang items were introduced: event_loop, and event_loop_factory. The idea of a "factory" is to define a function which can be called with no arguments and will return the new event loop as a trait object. This factory is emitted to the crate map when building an executable. The factory doesn't have to exist, and when it doesn't then an empty slot is in the crate map and a basic event loop with no I/O support is provided to the runtime. * When building an executable, then the rustuv crate will be linked by default (providing a default implementation of the event loop) via a similar method to injecting a dependency on libstd. This is currently the only location where the rustuv crate is ever linked. * There is a new #[no_uv] attribute (implied by #[no_std]) which denies implicitly linking to rustuv by default Closes #5019
2013-10-26Rewrite boxed_region/memory_region in RustAlex Crichton-2/+0
This drops more of the old C++ runtime to rather be written in rust. A few features were lost along the way, but hopefully not too many. The main loss is that there are no longer backtraces associated with allocations (rust doesn't have a way of acquiring those just yet). Other than that though, I believe that the rest of the debugging utilities made their way over into rust. Closes #8704
2013-10-19auto merge of #9834 : alexcrichton/rust/morestack, r=brsonbors-6/+3
This commit re-introduces the functionality of __morestack in a way that it was not originally anticipated. Rust does not currently have segmented stacks, rather just large stack segments. We do not detect when these stack segments are overrun currently, but this commit leverages __morestack in order to check this. This commit purges a lot of the old __morestack and stack limit C++ functionality, migrating the necessary chunks to rust. The stack limit is now entirely maintained in rust, and the "main logic bits" of __morestack are now also implemented in rust as well. I put my best effort into validating that this currently builds and runs successfully on osx and linux 32/64 bit, but I was unable to get this working on windows. We never did have unwinding through __morestack frames, and although I tried poking at it for a bit, I was unable to understand why we don't get unwinding right now. A focus of this commit is to implement as much of the logic in rust as possible. This involved some liberal usage of `no_split_stack` in various locations, along with some use of the `asm!` macro (scary). I modified a bit of C++ to stop calling `record_sp_limit` because this is no longer defined in C++, rather in rust. Another consequence of this commit is that `thread_local_storage::{get, set}` must both be flagged with `#[rust_stack]`. I've briefly looked at the implementations on osx/linux/windows to ensure that they're pretty small stacks, and I'm pretty sure that they're definitely less than 20K stacks, so we probably don't have a lot to worry about. Other things worthy of note: * The default stack size is now 4MB instead of 2MB. This is so that when we request 2MB to call a C function you don't immediately overflow because you have consumed any stack at all. * `asm!` is actually pretty cool, maybe we could actually define context switching with it? * I wanted to add links to the internet about all this jazz of storing information in TLS, but I was only able to find a link for the windows implementation. Otherwise my suggestion is just "disassemble on that arch and see what happens" * I put my best effort forward on arm/mips to tweak __morestack correctly, we have no ability to test this so an extra set of eyes would be useful on these spots. * This is all really tricky stuff, so I tried to put as many comments as I thought were necessary, but if anything is still unclear (or I completely forgot to take something into account), I'm willing to write more!