rust/src/libstd/rt
Alex Crichton 699b33d060 rustc: Support various flavors of linkages
It is often convenient to have forms of weak linkage or other various types of
linkage. Sadly, just using these flavors of linkage are not compatible with
Rust's typesystem and how it considers some pointers to be non-null.

As a compromise, this commit adds support for weak linkage to external symbols,
but it requires that this is only placed on extern statics of type `*T`.
Codegen-wise, we get translations like:

    // rust code
    extern {
        #[linkage = "extern_weak"]
        static foo: *i32;
    }

    // generated IR
    @foo = extern_weak global i32
    @_some_internal_symbol = internal global *i32 @foo

All references to the rust value of `foo` then reference `_some_internal_symbol`
instead of the symbol `_foo` itself. This allows us to guarantee that the
address of `foo` will never be null while the value may sometimes be null.

An example was implemented in `std::rt::thread` to determine if
`__pthread_get_minstack()` is available at runtime, and a test is checked in to
use it for a static value as well. Function pointers a little odd because you
still need to transmute the pointer value to a function pointer, but it's
thankfully better than not having this capability at all.
2014-03-11 08:25:42 -07:00
..
args.rs std: Rename unstable::mutex::Mutex to StaticNativeMutex. 2014-02-16 10:13:56 +11:00
at_exit_imp.rs Move replace and swap to std::mem. Get rid of std::util 2014-02-11 05:21:35 +08:00
bookkeeping.rs std: Move libnative task count bookkeeping to std 2014-03-05 21:48:08 -08:00
crate_map.rs std: Remove lots of allocations from log settings 2014-02-28 12:24:50 -08:00
env.rs Register new snapshots 2014-02-14 22:55:20 -08:00
global_heap.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
local.rs Publicise types/add #[allow(visible_private_types)] to a variety of places. 2014-03-01 00:12:34 +11:00
local_heap.rs std: Remove unstable::lang 2014-02-23 01:47:05 -08:00
local_ptr.rs Publicise types/add #[allow(visible_private_types)] to a variety of places. 2014-03-01 00:12:34 +11:00
logging.rs std: Remove lots of allocations from log settings 2014-02-28 12:24:50 -08:00
macros.rs Another round of test fixes from previous commits 2013-11-10 01:37:12 -08:00
mod.rs std: Move libnative task count bookkeeping to std 2014-03-05 21:48:08 -08:00
rtio.rs Roll std::run into std::io::process 2014-02-23 21:51:17 -08:00
stack.rs std: Tweak stack overflow printing for robustness 2014-02-25 16:51:52 -08:00
task.rs Spellcheck library docs. 2014-02-18 08:05:35 +11:00
thread.rs rustc: Support various flavors of linkages 2014-03-11 08:25:42 -07:00
thread_local_storage.rs Replace C types with Rust types in libstd, closes #7313 2014-01-22 19:20:47 +01:00
unwind.rs Publicise types/add #[allow(visible_private_types)] to a variety of places. 2014-03-01 00:12:34 +11:00
util.rs std: Move intrinsics to std::intrinsics. 2014-02-23 01:07:53 -08:00