about summary refs log tree commit diff
path: root/src/librustc_metadata/dynamic_lib.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-195/+0
2020-08-25Explicitly pass `RTLD_LOCAL` to `dlopen`Dylan MacKenzie-4/+4
This happens to be the default on Linux, but the default is unspecified in the POSIX standard. Also switches to `cast` to keep line lengths in check.
2020-08-25Always treat `dlsym` returning NULL as an errorDylan MacKenzie-31/+24
This simplifies the code somewhat. Also updates comments to reflect notes from reviw about thread-safety of `dlerror`.
2020-08-22Treat a NULL return from `dlsym` as an error on illumosDylan MacKenzie-4/+24
This works around behavior observed on illumos in #74469, in which foreign code (libc according to the OP) was racing with rustc to check `dlerror`.
2020-08-22Refactor dynamic library error checking on *nixDylan MacKenzie-34/+60
The old code was checking `dlerror` more often than necessary, since the return value of `dlopen` indicates whether an error occurred.
2020-04-25Remove support for self-openingMark Rousskov-36/+11
This was only used for linkage test cases, which is already covered by the run-make-fulldeps/symbol-visibility test -- which fairly extensively makes sure we're correctly exporting the right symbols at the right visibility (for various Rust crate types).
2020-03-22don't create variable bindings just to return the bound value immediately ↵Matthias Krüger-4/+2
(clippy::let_and_return)
2020-01-11use winapi for non-stdlib Windows bindingsAndy Russell-21/+12
2019-12-22Format the worldMark Rousskov-46/+25
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-47/+14
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-1/+1
2019-06-16Separate librustc_metadata modulechansuke-49/+1
2019-06-12Deprecate ONCE_INITSteven Fackler-2/+2
Once::new() has been a stable const fn for a while now. Closes #61746
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-08librustc_metadata => 2018Taiki Endo-2/+0
2018-12-25Remove licensesMark Rousskov-10/+0
2018-07-26rustc_metadata: test loading atoi instead of cosJosh Stone-13/+12
Some platforms don't actually have `libm` already linked in the test infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would fail to find the "cos" symbol. Every platform running this test should have `libc` and "atoi" though, so try to use that symbol instead. Fixes #45410.
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-4/+23
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2017-12-04rustc_back: move dynamic_lib to rustc_metadata.Irina-Gabriela Popa-0/+288