about summary refs log tree commit diff
path: root/library/unwind
AgeCommit message (Collapse)AuthorLines
2023-03-28Add OpenHarmony targetsAmanieu d'Antras-0/+16
- `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos`
2023-03-03Match unmatched backticks in library/est31-1/+1
2023-02-28Add QNX Neutrino support to libstdFlorian Bartels-0/+4
Co-authored-by: gh-tr <troach@qnx.com>
2022-12-30Replace libstd, libcore, liballoc in line comments.jonathanCogan-1/+1
2022-11-22Rollup merge of #104464 - mati865:reduce-eh-overallocation-amd64, r=thomccDylan DPC-1/+4
Reduce exceptions overallocation on non Windows x86_64 Addressing https://github.com/rust-lang/rust/pull/103894#discussion_r1020950196
2022-11-15Reduce exceptions overallocation on non Windows x86_64Mateusz Mikuła-1/+4
Addressing https://github.com/rust-lang/rust/pull/103894#discussion_r1020950196
2022-11-15Fix building of `aarch64-pc-windows-gnullvm`Mateusz Mikuła-1/+1
That change had been lost during rebase
2022-11-14Move most of unwind's build script to lib.rsbjorn3-24/+24
Only the android libunwind detection remains in the build script * Reduces dependence on build scripts for building the standard library * Reduces dependence on exact target names in favor of using semantic cfg(target_*) usage. * Keeps almost all code related to linking of the unwinder in one file
2022-11-13Rollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-SimulacrumManish Goregaokar-1/+1
Upgrade cc for working is_flag_supported on cross-compiles https://github.com/rust-lang/rust/pull/85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to https://github.com/rust-lang/cc-rs/issues/675, this didn't work properly on cross-compiles. https://github.com/rust-lang/cc-rs/commit/3eeb50b391a7543a6fed96276ee9388b5430a50d fixes this, and was released in cc 1.0.74, hence the upgrade
2022-11-13Auto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomccbors-6/+8
Change the way libunwind is linked for *-windows-gnullvm targets I have no idea why previous way works for `x86_64-fortanix-unknown-sgx` (assuming it actually works...) but not for `gnullvm`. It fails when linking libtest during Rust build (unless somebody adds `RUSTFLAGS='-Clinkarg=-lunwind'`). Also fixes exception handling on AArch64.
2022-11-12Bump unwinder private data size for AArch64 WindowsMateusz Mikuła-1/+4
This fixes unwinding on `aarch64-*-windows-gnu*`.
2022-11-09Upgrade cc to 1.0.76Tom Parker-Shemilt-1/+1
2022-11-05Remove linuxkernel targetsAlex Gaynor-1/+0
These are not used by the actual Rust-for-Linux project, so they're mostly just confusing.
2022-11-02Remove std's transitive dependency on cfg-if 0.1Collin Baker-1/+1
After rust-lang/rust#101946 this completes the move to cfg-if 1.0 by: * Updating getrandom 0.1.14->0.1.16 * Updating panic_abort, panic_unwind, and unwind to cfg-if 1.0
2022-11-01Change the way libunwind is linked for `*-windows-gnullvm` targetsMateusz Mikuła-5/+4
2022-10-29Upgrade cc for working is_flag_supported on cross-compilesTom Parker-Shemilt-1/+1
2022-08-15unwind: don't build dependency when building for MiriRalf Jung-1/+7
2022-08-10add crt-static for androidBryanskiy-6/+21
2022-07-20Rollup merge of #98101 - vladimir-ea:stdlib_watch_os, r=thomccDylan DPC-3/+3
stdlib support for Apple WatchOS This is a follow-up to https://github.com/rust-lang/rust/pull/95243 (Add Apple WatchOS compiler targets) that adds stdlib support for Apple WatchOS. `@deg4uss3r` `@nagisa`
2022-07-20Library changes for Apple WatchOSVladimir Michael Eatwell-3/+3
2022-07-01update cfg(bootstrap)sPietro Albini-1/+0
2022-06-09Stabilize the `bundle` native library modifierVadim Petrochenkov-1/+1
2022-06-03Fully stabilize NLLJack Huey-1/+0
2022-05-19Auto merge of #97033 - nbdd0121:unwind3, r=Amanieubors-4/+1
Remove libstd's calls to `C-unwind` foreign functions Remove all libstd and its dependencies' usage of `extern "C-unwind"`. This is a prerequiste of a WIP PR which will forbid libraries calling `extern "C-unwind"` functions to be compiled in `-Cpanic=unwind` and linked against `panic_abort` (this restriction is necessary to address soundness bug #96926). Cargo will ensure all crates are compiled with the same `-Cpanic` but the std is only compiled `-Cpanic=unwind` but needs the ability to be linked into `-Cpanic=abort`. Currently there are two places where `C-unwind` is used in libstd: * `__rust_start_panic` is used for interfacing to the panic runtime. This could be `extern "Rust"` * `_{rdl,rg}_oom`: a shim `__rust_alloc_error_handler` will be generated by codegen to call into one of these; they can also be `extern "Rust"` (in fact, the generated shim is used as `extern "Rust"`, so I am not even sure why these are not, probably because they used to `extern "C"` and was changed to `extern "C-unwind"` when we allow alloc error hooks to unwind, but they really should just be using Rust ABI). For dependencies, there is only one `extern "C-unwind"` function call, in `unwind` crate. This can be expressed as a re-export. More dicussions can be seen in the Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/soundness.20in.20mixed.20panic.20mode `@rustbot` label: T-libs F-c_unwind
2022-05-14Use re-export instead of inline wrapper in libunwindGary Guo-4/+1
This ensures that there are no calls to `C-unwind` function in libunwind.
2022-05-13Add LLVM based mingw-w64 targetsMateusz Mikuła-1/+6
2022-04-07Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrumbors-1/+0
Bump bootstrap compiler to 1.61.0 beta This PR bumps the bootstrap compiler to the 1.61.0 beta. The first commit changes the stage0 compiler, the second commit applies the "mechanical" changes and the third and fourth commits apply changes explained in the relevant comments. r? `@Mark-Simulacrum`
2022-04-05trivial cfg(bootstrap) changesPietro Albini-1/+0
2022-04-04Rely on #[link] attribute for unwind on Fuchsia.Adam Perry-2/+0
Closes #95575.
2022-03-30Stabilize native library modifier syntax and the `whole-archive` modifier ↵Vadim Petrochenkov-1/+1
specifically
2022-03-07Rollup merge of #93350 - gburgessiv:master, r=Mark-SimulacrumMatthias Krüger-0/+4
libunwind: readd link attrs to _Unwind_Backtrace It seems the removal of these in 1c07096a45a15de64216f12ec726333870e372b1 was unintended; readding them fixes the build. fixes rust-lang/rust#93349 r? `@alexcrichton`
2022-02-12library/unwind: Define unwinder_private_data_size for m68kJohn Paul Adrian Glaubitz-0/+3
2022-01-26libunwind: readd link attrs to _Unwind_BacktraceGeorge Burgess IV-0/+4
It seems the removal of these in 1c07096a45a15de64216f12ec726333870e372b1 was unintended; readding them fixes the build. fixes rust-lang/rust#93349
2021-12-23Switch all libraries to the 2021 editionDeadbeef-1/+1
2021-11-30Android: -ldl must appear after -lgcc when linkingAmanieu d'Antras-0/+3
2021-10-23Repace use of `static_nobundle` with `native_link_modifiers`Mateusz Mikuła-1/+0
This fixes warning when building Rust and running tests: ``` warning: library kind `static-nobundle` has been superseded by specifying `-bundle` on library kind `static`. Try `static:-bundle` warning: `rustc_llvm` (lib) generated 2 warnings (1 duplicate) ```
2021-10-06Add new target armv7-unknown-linux-uclibceabihfYannick Koehler-2/+2
Co-authored-by: Jonah Petri <jonah@petri.us>
2021-09-28Add SOLID targetsTomoaki Kawada-0/+1
SOLID[1] is an embedded development platform provided by Kyoto Microcomputer Co., Ltd. This commit introduces a basic Tier 3 support for SOLID. # New Targets The following targets are added: - `aarch64-kmc-solid_asp3` - `armv7a-kmc-solid_asp3-eabi` - `armv7a-kmc-solid_asp3-eabihf` SOLID's target software system can be divided into two parts: an RTOS kernel, which is responsible for threading and synchronization, and Core Services, which provides filesystems, networking, and other things. The RTOS kernel is a μITRON4.0[2][3]-derived kernel based on the open-source TOPPERS RTOS kernels[4]. For uniprocessor systems (more precisely, systems where only one processor core is allocated for SOLID), this will be the TOPPERS/ASP3 kernel. As μITRON is traditionally only specified at the source-code level, the ABI is unique to each implementation, which is why `asp3` is included in the target names. More targets could be added later, as we support other base kernels (there are at least three at the point of writing) and are interested in supporting other processor architectures in the future. # C Compiler Although SOLID provides its own supported C/C++ build toolchain, GNU Arm Embedded Toolchain seems to work for the purpose of building Rust. # Unresolved Questions A μITRON4 kernel can support `Thread::unpark` natively, but it's not used by this commit's implementation because the underlying kernel feature is also used to implement `Condvar`, and it's unclear whether `std` should guarantee that parking tokens are not clobbered by other synchronization primitives. # Unsupported or Unimplemented Features Most features are implemented. The following features are not implemented due to the lack of native support: - `fs::File::{file_attr, truncate, duplicate, set_permissions}` - `fs::{symlink, link, canonicalize}` - Process creation - Command-line arguments Backtrace generation is not really a good fit for embedded targets, so it's intentionally left unimplemented. Unwinding is functional, however. ## Dynamic Linking Dynamic linking is not supported. The target platform supports dynamic linking, but enabling this in Rust causes several problems. - The linker invocation used to build the shared object of `std` is too long for the platform-provided linker to handle. - A linker script with specific requirements is required for the compiled shared object to be actually loadable. As such, we decided to disable dynamic linking for now. Regardless, the users can try to create shared objects by manually invoking the linker. ## Executable Building an executable is not supported as the notion of "executable files" isn't well-defined for these targets. [1] https://solid.kmckk.com/SOLID/ [2] http://ertl.jp/ITRON/SPEC/mitron4-e.html [3] https://en.wikipedia.org/wiki/ITRON_project [4] https://toppers.jp/
2021-08-28build llvm libunwind.a in rustbuild12101111-154/+39
2021-08-10STD support for the ESP-IDF frameworkivmarkov-0/+1
2021-08-03rustc: Fill out remaining parts of C-unwind ABIAlex Crichton-7/+8
This commit intends to fill out some of the remaining pieces of the C-unwind ABI. This has a number of other changes with it though to move this design space forward a bit. Notably contained within here is: * On `panic=unwind`, the `extern "C"` ABI is now considered as "may unwind". This fixes a longstanding soundness issue where if you `panic!()` in an `extern "C"` function defined in Rust that's actually UB because the LLVM representation for the function has the `nounwind` attribute, but then you unwind. * Whether or not a function unwinds now mainly considers the ABI of the function instead of first checking the panic strategy. This fixes a miscompile of `extern "C-unwind"` with `panic=abort` because that ABI can still unwind. * The aborting stub for non-unwinding ABIs with `panic=unwind` has been reimplemented. Previously this was done as a small tweak during MIR generation, but this has been moved to a separate and dedicated MIR pass. This new pass will, for appropriate functions and function calls, insert a `cleanup` landing pad for any function call that may unwind within a function that is itself not allowed to unwind. Note that this subtly changes some behavior from before where previously on an unwind which was caught-to-abort it would run active destructors in the function, and now it simply immediately aborts the process. * The `#[unwind]` attribute has been removed and all users in tests and such are now using `C-unwind` and `#![feature(c_unwind)]`. I think this is largely the last piece of the RFC to implement. Unfortunately I believe this is still not stabilizable as-is because activating the feature gate changes the behavior of the existing `extern "C"` ABI in a way that has no replacement. My thinking for how to enable this is that we add support for the `C-unwind` ABI on stable Rust first, and then after it hits stable we change the behavior of the `C` ABI. That way anyone straddling stable/beta/nightly can switch to `C-unwind` safely.
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-13Upgrade `cc` crate to 1.0.69Yuki Okushi-1/+1
2021-06-01Support Android ndk versions `r23-beta3` and upTilmann Meyer-0/+14
Since android ndk version `r23-beta3`, `libgcc` has been replaced with `libunwind`. This moves the linking of `libgcc`/`libunwind` into the `unwind` crate where we check if the system compiler can find `libunwind` and fall back to `libgcc` if needed.
2021-05-27Auto merge of #84124 - 12101111:libunwind, r=petrochenkovbors-76/+98
libunwind fix and cleanup Fix: 1. "system-llvm-libunwind" now only skip build-script for linux target 2. workaround from https://github.com/rust-lang/rust/pull/65972 is not needed, upstream fix it in https://github.com/llvm/llvm-project/commit/68c50708d1f2b9aee3f10ec710df0b1387f701e5 ( LLVM 11 ) 3. remove code for MSCV and Apple in `compile()`, as they are not used 4. fix https://github.com/rust-lang/rust/issues/69222 , compile c files and cpp files in different config 5. fix conditional compilation for musl target. 6. fix that x86_64-fortanix-unknown-sgx don't link libunwind built in build-script into rlib
2021-05-26cleanup and fix compiling of libunwind12101111-76/+98
fix conditional compiling of llvm-libunwind feaure for musl target. update document of llvm-libunwind feature.
2021-05-24Update ccChris Denton-1/+1
Recent commits to cc have helped to address #83043 and #43468
2021-05-12update cc crateMateusz Mikuła-1/+1
To pull in this fix: https://github.com/alexcrichton/cc-rs/commit/801a87bf2f31ad1ad8bd7e8fa4f5a52b0e2b4c00
2021-03-22Rollup merge of #82374 - clehner:licenses, r=joshtriplettDylan DPC-0/+2
Add license metadata for std dependencies These five crates are in the dependency tree of `std` but lack license metadata: - `alloc` - `core` - `panic_abort` - `panic_unwind` - `unwind` Querying the dependency tree of `std` is a useful thing to be able to do, since these crates will typically be linked into Rust binaries. Tools show the license fields missing, as seen in https://github.com/rust-lang/rust/issues/67014#issuecomment-782704534. This PR adds the license field for the five crates, based on the license of the `std` package and this repo as a whole. I also added the `repository` and `descriptions` fields, since those seem useful. For `description`, I copied text from top-level comments for the respective modules - except for `unwind` which has none. I also note that https://github.com/rust-lang/rust/pull/73530 attempted to add license metadata for all crates in this repo, but was rejected because there was question about some of them. I hope that this smaller change, focusing only on the runtime dependencies, will be easier to review. cc `@Mark-Simulacrum` `@Lokathor`
2021-03-01Change built-in kernel targets to be os = none throughoutJohn Ericson-1/+1
Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code that is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to #74247 Thanks @ojeda for catching some things.