about summary refs log tree commit diff
path: root/src/rt/rustrt.def.in
AgeCommit message (Collapse)AuthorLines
2013-11-29Statically link librustrt to libstdAlex Crichton-51/+0
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-19Implement more native file I/OAlex Crichton-7/+0
This implements a fair amount of the unimpl() functionality in io::native relating to filesystem operations. I've also modified all io::fs tests to run in both a native and uv environment (so everything is actually tested). There are a two bits of remaining functionality which I was unable to get working: * change_file_times on windows * lstat on windows I think that change_file_times may just need a better interface, but lstat has a large implementation in libuv which I didn't want to tackle trying to copy.
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-20/+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-18Implement a native mutex typeAlex Crichton-2/+3
This mutex is built on top of pthreads for unix and the related windows apis on windows. This is a straight port of the lock_and_signal type from C++ to rust. Almost all operations on the type are unsafe, and it's definitely not recommended for general use. Closes #9105
2013-11-18rt: Namespace all C functions under rust_Brian Anderson-3/+3
2013-11-13add rust_trylock_little_lockJason Toffaletti-0/+1
Try to acquire lock and succeed only if lock is not already held. Uses TryEnterCriticalSection or pthread_mutex_trylock.
2013-11-05Move implementation for threads to RustDirkjan Bussink-3/+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-115/+0
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-6/+0
Closes #10103
2013-10-29rt: Remove four unused upcallsBrian Anderson-4/+0
2013-10-26Rewrite boxed_region/memory_region in RustAlex Crichton-7/+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-24Implement a basic event loop built on LittleLockAlex Crichton-0/+2
It's not guaranteed that there will always be an event loop to run, and this implementation will serve as an incredibly basic one which does not provide any I/O, but allows the scheduler to still run. cc #9128
2013-10-24Another round of test fixes and merge conflictsAlex Crichton-2/+0
2013-10-24wrapping libuv signal for use in RustDo Nhat Minh-0/+3
descriptive names easier-to-use api reorganize and document
2013-10-24Test fixes and merge conflictsAlex Crichton-12/+0
2013-10-24Move as much I/O as possible off of native::ioAlex Crichton-0/+1
When uv's TTY I/O is used for the stdio streams, the file descriptors are put into a non-blocking mode. This means that other concurrent writes to the same stream can fail with EAGAIN or EWOULDBLOCK. By all I/O to event-loop I/O, we avoid this error. There is one location which cannot move, which is the runtime's dumb_println function. This was implemented to handle the EAGAIN and EWOULDBLOCK errors and simply retry again and again.
2013-10-24Don't attempt to export uv functions directlyAlex Crichton-7/+6
2013-10-24Move rt::io::stdio from FileStream to a TTYAlex Crichton-0/+4
We get a little more functionality from libuv for these kinds of streams (things like terminal dimentions), and it also appears to more gracefully handle the stream being a window. Beforehand, if you used stdio and hit CTRL+d on a process, libuv would continually return 0-length successful reads instead of interpreting that the stream was closed. I was hoping to be able to write tests for this, but currently the testing infrastructure doesn't allow tests with a stdin and a stdout, but this has been manually tested! (not that it means much)
2013-10-24Implement io::net::unixAlex Crichton-0/+15
2013-10-20auto merge of #9812 : HNO3/rust/windows-utf8, r=alexcrichtonbors-0/+2
This fixes #9418 and #9618, and potential problems related to directory walking.
2013-10-20Fix unicode errors on Windows in path_is_dir, path_exists, getcwd and ↵LEE Wondong-0/+2
rust_localtime. This make these functions use wchar_t version of APIs, instead of char version.
2013-10-19Use __morestack to detect stack overflowAlex Crichton-1/+0
This commit resumes management of the stack boundaries and limits when switching between tasks. This additionally leverages the __morestack function to run code on "stack overflow". The current behavior is to abort the process, but this is probably not the best behavior in the long term (for deails, see the comment I wrote up in the stack exhaustion routine).
2013-10-16drop the linenoise libraryDaniel Micay-9/+0
Closes #5038
2013-10-09auto merge of #9664 : alexcrichton/rust/logging, r=huonwbors-3/+0
This makes some headway on #3309, see commits for details.
2013-10-09std::rand: make the windows OSRng more correct, remove some C++.Huon Wilson-1/+3
This lets the C++ code in the rt handle the (slightly) tricky parts of random number generation: e.g. error detection/handling, and using the values of the `#define`d options to the various functions.
2013-10-05Fix thread safety issues in dynamic_libSteven Fackler-0/+2
The root issue is that dlerror isn't reentrant or even thread safe. The Windows code isn't affected since errno is thread-local on Windows and it's running in an atomically block to ensure there isn't a green thread context switch. Closes #8156
2013-10-03Document logging and remove old functionsAlex Crichton-3/+0
This adds a large doc-block to the top of the std::logging module explaining how to use it. This is mostly just making sure that all the information in the manual's section about logging is also here (in case someone decides to look into this module first). This also removes the old console_{on,off} methods. As far as I can tell, the functions were only used by the compiler, and there's no reason for them to be used because they're all turned off by default anyway (maybe they were turned on by default at some point...) I believe that this is the final nail in the coffin and closes #5021
2013-09-25rustdoc: Add sundown to src/rt/Alex Crichton-0/+6
This also starts compiling it in the same manner as linenoise, it's just bundled with librustrt directly, and we export just a few symbols out of it.
2013-09-23Remove the C(++) ISAAC Rng from the old rt.Huon Wilson-4/+0
This has to leave rust_gen_seed and rng_gen_seed around since they're used to initialise the std::rand RNGs.
2013-09-18auto merge of #9280 : alexcrichton/rust/less-c++, r=brsonbors-1/+0
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674 Because less C++ is better C++!
2013-09-18Remove rust_run_program.cppAlex Crichton-1/+0
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674
2013-09-18Implement process bindings to libuvAlex Crichton-0/+7
This is a re-landing of #8645, except that the bindings are *not* being used to power std::run just yet. Instead, this adds the bindings as standalone bindings inside the rt::io::process module. I made one major change from before, having to do with how pipes are created/bound. It's much clearer now when you can read/write to a pipe, as there's an explicit difference (different types) between an unbound and a bound pipe. The process configuration now takes unbound pipes (and consumes ownership of them), and will return corresponding pipe structures back if spawning is successful (otherwise everything is destroyed normally).
2013-09-16std: bind uv_fs_readdir(), flesh out DirectoryInfo and docs/cleanupJeff Olson-0/+2
2013-09-16std/rt: in-progress file io workJeff Olson-0/+5
std: remove unneeded field from RequestData struct std: rt::uv::file - map us_fs_stat & start refactoring calls into FsRequest std: stubbing out stat calls from the top-down into uvio std: us_fs_* operations are now by-val self methods on FsRequest std: post-rebase cleanup std: add uv_fs_mkdir|rmdir + tests & minor test cleanup in rt::uv::file WORKING: fleshing out FileStat and FileInfo + tests std: reverting test files.. refactoring back and cleanup...
2013-09-13Remove all usage of change_dir_lockedAlex Crichton-2/+0
While usage of change_dir_locked is synchronized against itself, it's not synchronized against other relative path usage, so I'm of the opinion that it just really doesn't help in running tests. In order to prevent the problems that have been cropping up, this completely removes the function. All existing tests (except one) using it have been moved to run-pass tests where they get their own process and don't need to be synchronized with anyone else. There is one now-ignored rustpkg test because when I moved it to a run-pass test apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having linkage failures).
2013-09-12auto merge of #9087 : fhahn/rust/rust_crate_map, r=brsonbors-1/+0
This patch converts the rust_crate_map.cpp to Rust as mentioned at the end of #8880.
2013-09-13Convert rust_crate_map.cpp to RustFlorian Hahn-1/+0
Conflicts: src/libstd/rt/logging.rs
2013-09-12Add linenoise lock helpers to rustrt.def.in.Huon Wilson-0/+2
2013-09-06Upgrade libuv to the current master (again)Alex Crichton-1/+0
This is a reopening of the libuv-upgrade part of #8645. Hopefully this won't cause random segfaults all over the place. The windows regression in testing should also be fixed (it shouldn't build the whole compiler twice). A notable difference from before is that gyp is now a git submodule instead of always git-cloned at make time. This allows bundling for releases more easily. Closes #8850
2013-09-05std::rt: Add libuv bindings for getaddrinfoBrian Anderson-0/+1
2013-09-04Convert rust_log.cpp to Rust, closes #8703Florian Hahn-2/+2
2013-08-29Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, ↵Brian Anderson-8/+2
r=brson" This reverts commit b8d1fa399402c71331aefd634d710004e00b73a6, reversing changes made to f22b4b169854c8a4ba86c16ee43327d6bcf94562. Conflicts: mk/rt.mk src/libuv
2013-08-27Implement process bindings to libuvAlex Crichton-0/+7
Closes #6436
2013-08-27Upgrade libuv to the current master + our patchesAlex Crichton-2/+1
There were two main differences with the old libuv and the master version: 1. The uv_last_error function is now gone. The error code returned by each function is the "last error" so now a UvError is just a wrapper around a c_int. 2. The repo no longer includes a makefile, and the build system has change. According to the build directions on joyent/libuv, this now downloads a `gyp` program into the `libuv/build` directory and builds using that. This shouldn't add any dependences on autotools or anything like that. Closes #8407 Closes #6567 Closes #6315
2013-08-24std: Convert the runtime TLS key to a Rust global to avoid FFIBrian Anderson-1/+0
2013-08-23rt: Remove old precise GC codeBrian Anderson-2/+0
2013-08-23rt: Move some test functions to rust_test_helpersBrian Anderson-4/+4
2013-08-23rt: Remove exit_status helpersBrian Anderson-2/+0
2013-08-22std: remove fcntl const bindings + making valgrind clean w/ no owned vecsJeff Olson-9/+0
2013-08-22std: add read and unlink to low-level FileDescriptor + end-to-end CRUD testJeff Olson-0/+2