about summary refs log tree commit diff
path: root/src/libpanic_abort
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-138/+0
2020-07-17Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbinibors-1/+1
Bump version to 1.47 This also bumps to a more recent rustfmt version, just to keep us relatively up to date (though almost nothing has changed in rustfmt we use beyond bumps to the parser infra). No formatting changes as a result of this. r? @pietroalbini
2020-07-16apply bootstrap cfgsMark Rousskov-1/+1
2020-07-15Tweak formatting.Eric Huss-1/+2
2020-07-15Use cfg_if in libpanic_abort.Eric Huss-16/+19
This allows setting a default abort using the core intrinsic.
2020-06-24lints: add `improper_ctypes_definitions`David Wood-0/+1
This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: David Wood <david@davidtw.co>
2020-04-25Bump bootstrap compilerMark Rousskov-9/+0
2020-03-05Simplify the try intrinsic by using a callback in the catch blockAmanieu d'Antras-4/+1
2020-03-05Use #[rustc_std_internal_symbol] instead of #[no_mangle]Amanieu d'Antras-5/+5
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-2/+1
2020-03-02Apply review feedbackAmanieu d'Antras-1/+5
2020-03-02Fix some minor issuesAmanieu d'Antras-2/+3
2020-03-02Inline catching panics into std::catch_unwindMark Rousskov-10/+3
This allows LLVM to inline the happy path, such that catching unwinding is zero-cost when no panic occurs. This also allows us to match the code generated by C++ try/catch.
2019-12-22Format the worldMark Rousskov-34/+29
2019-11-13Revert "Auto merge of #65134 - ↵Robin Kruppe-1/+0
davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe" This reverts commit 3f0e16473de5ec010f44290a8c3ea1d90e0ad7a2, reversing changes made to 61a551b4939ec1d5596e585351038b8fbd0124ba.
2019-11-05improper_ctypes: `extern "C"` fnsDavid Wood-0/+1
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-1/+2
- the old interface between HermitCore and the Rust Standard Library based on a small C library (newlib) - remove this interface and call directly the unikernel - remove the dependency to the HermitCore linker - use rust-lld as linker
2019-08-06redox: convert to target_family unixJeremy Soller-2/+1
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-02-14SGX target: fix panic = abortJethro Beekman-2/+3
2019-02-10Revert removed #![feature(nll)]Taiki Endo-0/+1
2019-02-07Remove images' url to make it work even without internet connectionGuillaume Gomez-3/+1
2019-02-03libpanic_abort => 2018Mazdak Farrokhzad-2/+3
2019-01-26Bump bootstrap compiler to 1.33 betaMark Rousskov-1/+0
2019-01-14Stabilize `cfg_target_vendor`, #29718Jethro Beekman-1/+1
2018-12-31Bound sgx target_env with fortanix as target_vendorYu Ding-1/+2
Signed-off-by: Yu Ding <dingelish@gmail.com>
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-2/+2
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-07Add x86_64-fortanix-unknown-sgx target to libstd and dependenciesJethro Beekman-0/+6
The files src/libstd/sys/sgx/*.rs are mostly copied/adapted from the wasm target. This also updates the dlmalloc submodule to the very latest version.
2018-11-08wasm32-unknown-emscripten expects the rust_eh_personality symbolChristopher Serr-1/+4
The `wasm32-unknown-emscripten` expects the `rust_eh_personality` symbol to be there, but a cfg checking for `target_arch = "wasm32"` which was meant to remove the symbol from the `wasm32-unknown-unknown` target, didn't check for whether `emscripten` is targeted or not, so the symbol accidentally got filtered out there as well. Fixes #55276
2018-10-02wasm: Explicitly export all symbols with LLDAlex Crichton-3/+8
This commit fixes an oddity on the wasm target where LTO can produce working executables but plain old optimizations doesn't. The compiler already knows what set of symbols it would like to export, but LLD only discovers this list transitively through symbol visibilities. LLD may not, however, always find all the symbols that we'd like to export. For example if you depend on an rlib with a `#[no_mangle]` symbol, then if you don't actually use anything from the rlib then the symbol won't appear in the final artifact! It will appear, however, with LTO. This commit attempts to rectify this situation by ensuring that all symbols rustc would otherwise preserve through LTO are also preserved through the linking process with LLD by default.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-3/+1
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-26rustc: Continue to tweak "std internal symbols"Alex Crichton-2/+2
In investigating [an issue][1] with `panic_implementation` defined in an executable that's optimized I once again got to rethinking a bit about the `rustc_std_internal_symbol` attribute as well as weak lang items. We've sort of been non-stop tweaking these items ever since their inception, and this continues to the trend. The crux of the bug was that in the reachability we have a [different branch][2] for non-library builds which meant that weak lang items (and std internal symbols) weren't considered reachable, causing them to get eliminiated by ThinLTO passes. The fix was to basically tweak that branch to consider these symbols to ensure that they're propagated all the way to the linker. Along the way I've attempted to erode the distinction between std internal symbols and weak lang items by having weak lang items automatically configure fields of `CodegenFnAttrs`. That way most code no longer even considers weak lang items and they're simply considered normal functions with attributes about the ABI. In the end this fixes the final comment of #51342 [1]: https://github.com/rust-lang/rust/issues/51342#issuecomment-414368019 [2]: https://github.com/rust-lang/rust/blob/35bf1ae25799a4e62131159f052e0a3cbd27c960/src/librustc/middle/reachable.rs#L225-L238
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-09[nll] libpanic_abort: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-1/+0
2018-07-12Deny bare trait objects in the rest of rustljedrz-0/+1
2018-04-13std: Minimize size of panicking on wasmAlex Crichton-1/+1
This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-07Inject the `compiler_builtins` crate whenever the `core` crate is injectedOliver Schneider-0/+1
2018-01-30rustc: Add an option to default hidden visibilityAlex Crichton-0/+3
This commit adds a new option to target specifictions to specify that symbols should be "hidden" visibility by default in LLVM. While there are no existing targets that take advantage of this the `wasm32-unknown-unknown` target will soon start to use this visibility. The LLD linker currently interprets `hidden` as "don't export this from the wasm module" which is what we want for 90% of our functions. While the LLD linker does have a "export this symbol" argument which is what we use for other linkers, it was also somewhat easier to do this change instead which'll involve less arguments flying around. Additionally there's no need for non-`hidden` visibility for most of our symbols! This change should not immediately impact the wasm targets as-is, but rather this is laying the foundations for soon integrating LLD as a linker for wasm code.
2018-01-05Let libpanic_abort call into libc's abort() on CloudABI.Ed Schouten-1/+1
Ideally, we should make use of CloudABI's internal proc_raise(SIGABRT) system call. POSIX abort() requires things like flushing of stdios, which may not be what we want under panic conditions. Invoking the raw CloudABI system call would have prevented that. Unfortunately, we have to make use of the "cloudabi" crate to invoke raw CloudABI system calls. This is undesired, as discussed in the pull request (#47190).
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-7/+8
This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". --- Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is still getting LLVM bugs fixed to get that working and will take some time. Relatively simple programs all seem to work though! --- It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-2/+0
Fixes #41701.
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-30std: Don't build docs for misc facade cratesAlex Crichton-0/+1
Retain the same behavior as stable. Closes #38319
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-12Merge branch 'master' into redoxJeremy Soller-0/+1