about summary refs log tree commit diff
path: root/src/rt
AgeCommit message (Collapse)AuthorLines
2014-10-02remove the uv_support codeDaniel Micay-169/+0
2014-10-02rm libuv-auto-clean-triggerDaniel Micay-2/+0
2014-09-06readdir: return error instead of failing on invalid UTF-16Peter Atashian-27/+0
Fixes #15279 Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-08Move system header includes above valgrind.h includeChris Nixon-4/+4
This allows rustc to be build under msys2's mingw64 gcc
2014-08-05Added clarification regarding rust_try_inner.Vadim Chugunov-1/+2
2014-08-04Implement unwinding for Win64.Vadim Chugunov-9/+25
The original trick used to trigger unwinds would not work with GCC's implementation of SEH, so I had to invent a new one: rust_try now consists of two routines: the outer one, whose handler triggers unwinds, and the inner one, that stops unwinds by having a landing pad that swallows exceptions and passes them on to the outer routine via a normal return.
2014-08-04Fix valgrind.h for Win64.Vadim Chugunov-30/+31
_WIN32 is defined for 64-bit builds as well, so test for _WIN64 first.
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-3/+10
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-06-24auto merge of #14963 : w3ln4/rust/master, r=alexcrichtonbors-0/+171
The aim of these changes is not working out a generic bi-endianness architectures support but to allow people develop for little endian MIPS machines (issue #7190).
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+171
2014-06-21Add missing attributes to indirect calls for foreign functionsBjörn Steinbrink-0/+18
When calling a foreign function, some arguments and/or return value attributes are required to conform to the foreign ABI. Currently those attributes are only added to the declaration of foreign functions. With direct calls, this is no problem, because LLVM can see that those attributes apply to the call. But with an indirect call, LLVM cannot do that and the attribute is missing. To fix that, we have to add those attribute to the calls to foreign functions as well. This also allows to remove the special handling of the SRet attribute, which is ABI-dependent and will be set via the `attr` field of the return type's `ArgType`.
2014-06-13Cosmetic fixes & commentsValerii Hiora-1/+5
2014-06-12Runtime support for arm on iOSValerii Hiora-34/+74
2014-05-22libtime: Remove the `tz_zone` field from times.Patrick Walton-36/+6
It depends on `~str`.
2014-05-14update valgrind headersDaniel Micay-512/+1859
2014-05-11make sure jemalloc valgrind support is enabledDaniel Micay-1/+1
This requires pointing it at the valgrind headers we carry in-tree.
2014-05-03rustdoc: Migrate from sundown to hoedownAlex Crichton-5448/+0
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-24Update libuvAlex Crichton-1/+1
This update brings a few months of changes, but primarily a fix for the following situation. When creating a handle to stdin, libuv used to set the stdin handle to nonblocking mode. This would end up affect this stdin handle across all processes that shared it, which mean that stdin become nonblocking for everyone using the same stdin. On linux, this also affected *stdout* because stdin/stdout roughly point at the same thing. This problem became apparent when running the test suite manually on a local computer. The stdtest suite (running with libgreen) would set stdout to nonblocking mode (as described above), and then the next test suite would always fail for a printing failure (because stdout was returning EAGAIN). This has been fixed upstream, joyent/libuv@342e8c, and this update pulls in this fix. This also brings us in line with a recently upstreamed libuv patch. Closes #13336 Closes #13355
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-08Fix spelling errors in comments.Joseph Crail-1/+1
2014-03-25rustuv: Handle short writes in uv_fs_writeAlex Crichton-1/+1
The libuv fs wrappers are very thin wrappers around the syscalls they correspond to, and a notable worrisome case is the write syscall. This syscall is not guaranteed to write the entire buffer provided, so we may have to continue calling uv_fs_write if a short write occurs. Closes #13130
2014-03-21rand: Rewrite OsRng in Rust for windowsAlex Crichton-59/+0
This removes even more rust_builtin.c code, and allows us to more gracefully handle errors (not a process panic, but a task failure).
2014-03-19rustc: Fix x86 ffi for empty struct argumentsklutzy-0/+23
2014-03-14fix MIPS targetJyun-Yan You-25/+8
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure.
2014-03-12std: Move rand to librand.Huon Wilson-1/+1
This functionality is not super-core and so doesn't need to be included in std. It's possible that std may need rand (it does a little bit now, for io::test) in which case the functionality required could be moved to a secret hidden module and reexposed by librand. Unfortunately, using #[deprecated] here is hard: there's too much to mock to make it feasible, since we have to ensure that programs still typecheck to reach the linting phase.
2014-03-05native: Stop using readdir()Alex Crichton-3/+12
This function is not threadsafe, and is deprecated in favor of the threadsafe readdir_r variant. Closes #12692
2014-02-16Upgrade libuvAlex Crichton-1/+1
This notably includes joyent/libuv@6f62d62c in order to fix when processes fail to spawn on windows
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-0/+41
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-03std: Hardcode pthread constants and structuresAlex Crichton-20/+0
This allows for easier static initialization of a pthread mutex, although the windows mutexes still sadly suffer. Note that this commit removes the clone() method from a mutex because it no longer makes sense for pthreads mutexes. This also removes the Once type for now, but it'll get added back shortly.
2014-01-26Removed all instances of XXX in preparation for relaxing of FIXME ruleSalem Talha-1/+1
2014-01-20rustuv: Re-work sockaddr glue to not use mallocAlex Crichton-44/+0
This means we can purge even more C from src/rt!
2014-01-03rt: Define exp10 on AndroidBrian Anderson-0/+5
LLVM appears to generate calls to exp10 on ARM and bionic does not define it.
2013-12-30Convert some C functions to rust functionsAlex Crichton-67/+0
Right now on linux, an empty executable with LTO still depends on librt becaues of the clock_gettime function in rust_builtin.o, but this commit moves this dependency into a rust function which is subject to elimination via LTO. At the same time, this also drops libstd's dependency on librt on unices that are not OSX because the library is only used by extra::time (and now the dependency is listed in that module instead).
2013-12-26Register new snapshotsAlex Crichton-92/+0
2013-12-24Remove rust_globals.hBrian Anderson-143/+37
2013-12-24Stop using C++ exceptions for stack unwinding.Vadim Chugunov-31/+37
2013-12-22uv: Suppress a warning by using an absolute pathAlex Crichton-0/+2
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-12-07Register new snapshotsAlex Crichton-9/+0
This transitions the snapshot dependency process to understand that our snapshots are now a single static binary rather than an array of files.
2013-12-05Remove unused upcallsAlex Crichton-1/+2
The main one removed is rust_upcall_reset_stack_limit (continuation of #10156), and this also removes the upcall_trace function. The was hidden behind a `-Z trace` flag, but if you attempt to use this now you'll get a linker error because there is no implementation of the 'upcall_trace' function. Due to this no longer working, I decided to remove it entirely from the compiler (I'm also a little unsure on what it did in the first place).
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-22Remove sjlj stuff from rust_upcall and don't pass -Werror to libuv.Luqman Aden-11/+0
2013-11-22Fix up mingw64 target.Luqman Aden-7/+18
2013-11-19Implement more native file I/OAlex Crichton-63/+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-18Move runtime files to C instead of C++Alex Crichton-178/+198
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-441/+2
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/+24
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-16/+16
2013-11-13add rust_trylock_little_lockJason Toffaletti-0/+33
Try to acquire lock and succeed only if lock is not already held. Uses TryEnterCriticalSection or pthread_mutex_trylock.
2013-11-12rt: Delete more C++Brian Anderson-141/+10
2013-11-11auto merge of #10403 : poiru/rust/issue-2675, r=alexcrichtonbors-9/+11
Closes #2675.