-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove the need for foreign ABI wrappers #10116
Comments
Can you elaborate on what leads to an infinitely recursing function? |
@nikomatsakis: LLVM's |
Out of curiosity, is there even still a need for these wrappers? Rust seems to support multiple calling conventions without any trouble. I believe used to the challenge was we needed to pass things like a task pointer around, but now I think Rust get's these from TLS. |
@eholk: I think the only reason the wrappers exist is that Rust doesn't currently know how to output the ABI <-> ABI casts directly inside the function it's generating. The code generation for function bodies just assumes it's directly using the parameters and only knows about the Rust ABI. |
Can we run LLVM passes in different orders to make the inlining issues go away? |
@brson: I don't think so. The |
The core library in theory has 0 dependencies, but in practice it has some in order for it to be efficient. These dependencies are in the form of the basic memory operations provided by libc traditionally, such as memset, memcmp, etc. These functions are trivial to implement and themselves have 0 dependencies. This commit adds a new crate, librlibc, which will serve the purpose of providing these dependencies. The crate is never linked to by default, but is available to be linked to by downstream consumers. Normally these functions are provided by the system libc, but in other freestanding contexts a libc may not be available. In these cases, librlibc will suffice for enabling execution with libcore. cc rust-lang#10116
The core library in theory has 0 dependencies, but in practice it has some in order for it to be efficient. These dependencies are in the form of the basic memory operations provided by libc traditionally, such as memset, memcmp, etc. These functions are trivial to implement and themselves have 0 dependencies. This commit adds a new crate, librlibc, which will serve the purpose of providing these dependencies. The crate is never linked to by default, but is available to be linked to by downstream consumers. Normally these functions are provided by the system libc, but in other freestanding contexts a libc may not be available. In these cases, librlibc will suffice for enabling execution with libcore. cc rust-lang#10116
The core library in theory has 0 dependencies, but in practice it has some in order for it to be efficient. These dependencies are in the form of the basic memory operations provided by libc traditionally, such as memset, memcmp, etc. These functions are trivial to implement and themselves have 0 dependencies. This commit adds a new crate, librlibc, which will serve the purpose of providing these dependencies. The crate is never linked to by default, but is available to be linked to by downstream consumers. Normally these functions are provided by the system libc, but in other freestanding contexts a libc may not be available. In these cases, librlibc will suffice for enabling execution with libcore. cc rust-lang#10116
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
`not_unsafe_ptr_arg_deref` update documentation changelog: [`not_unsafe_ptr_arg_deref`]: strengthened documentation wording, fixes rust-lang#7714
To generate code for
extern "C" fn foo()
,rustc
will create a Rust function and wrap it inside a function exposing the C ABI. This is bad for compile-time, but more importantly it makes it very hard to write functions likememset
,memcpy
andmemmove
for freestanding Rust because LLVM will kindly replace their body with a call to the intrinsic, and then lower that to an infinitely recursive function.https://github.com/thestinger/rust-core#freestanding
The text was updated successfully, but these errors were encountered: