Skip to content
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

Modernize the codebase #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 89 additions & 204 deletions .github/workflows/test.yml

Large diffs are not rendered by default.

38 changes: 2 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,2 @@
[package]
name = "stacker"
version = "0.1.15"
authors = ["Alex Crichton <[email protected]>", "Simonas Kazlauskas <[email protected]>"]
build = "build.rs"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/stacker"
homepage = "https://github.com/rust-lang/stacker"
documentation = "https://docs.rs/stacker/0.1.15"
description = """
A stack growth library useful when implementing deeply recursive algorithms that
may accidentally blow the stack.
"""

[lib]
name = "stacker"
doctest = false
test = false

[dependencies]
cfg-if = "1.0.0"
libc = "0.2.45"
psm = { path = "psm", version = "0.1.7" }

[target.'cfg(windows)'.dependencies.windows-sys]
version = ">=0.34.0, <0.42.0"
features = [
"Win32_System_Memory",
"Win32_System_Threading",
"Win32_Foundation",
]


[build-dependencies]
cc = "1.0.2"
[workspace]
members = ["stacker", "psm"]
4 changes: 2 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[target.x86_64-linux-android]
image = "rustembedded/cross:x86_64-linux-android"
[target.x86_64-unknown-freebsd.env]
passthrough = ["AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd12-ar"]
44 changes: 0 additions & 44 deletions README.md

This file was deleted.

20 changes: 20 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div align="center">
<h1><code>stacker & psm</code></h1>
</div>

Check out the README for corresponding crates for further information on each crate.

# License

This project is licensed under either of

* [Apache License, Version 2.0](<https://www.apache.org/licenses/LICENSE-2.0>)
* [MIT license](<https://opensource.org/licenses/MIT>)

at your option.

## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this project by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
7 changes: 7 additions & 0 deletions psm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ repository = "https://github.com/rust-lang/stacker/"
documentation = "https://docs.rs/psm/0.1.20"
readme = "README.mkd"

[lib]
harness = false

[dependencies]
cfg-if = "1.0.0"

[build-dependencies]
cc = "1.0.2"

[dev-dependencies]
backtrace = "0.3"
58 changes: 32 additions & 26 deletions psm/README.mkd
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
# Portable Stack Manipulation

This crate provides very portable functions to control the stack pointer and inspect the properties
of the stack. This crate does not attempt to provide safe abstractions to any operations, the
only goals are correctness, portability and efficiency (in that exact order). As a consequence most
functions you’ll see in this crate are unsafe.

Unless you’re writing a safe abstraction over stack manipulation, this is not the crate you
want. Instead consider one of the safe abstractions over this crate. A good place to look at is
the crates.io’s reverse dependency list.
<div align="center">
<h1><code>psm</code></h1>
<p>
<strong>A portable library of stack introspection and manipulation operations</strong>
</p>
</div>

This crate provides functions to control the stack pointer and inspect the properties of the stack.
This crate does not attempt to provide safe or Rust-idiomatic abstractions to any of the
operations. The only goals are correctness, portability and efficiency (in this exact order). As a
consequence most functions you’ll see in this crate are unsafe and require the caller to maintain a
variety of invariants.

Unless you are writing a safe abstraction over stack manipulation or need extremely precse control
over your stack, this is probably not the crate you want. Instead consider one of the safe
abstractions based on this crate. A good place to look at is the crates.io’s reverse dependency
list.

# Platform support

The following table lists supported targets and architectures with notes on the level of current
support and knowledge about the target. The three columns “Available”, “Tested” and “Callstack”
imply an increasingly high level of support.
The following table lists targets and architectures supported by this crate, alongside the notes on
the current level of support and behaviour. The three columns “Available”, “Tested” and “Callstack”
indicate different degrees of support:

* “Available” basically means that the code builds and the assembly files have been written for the
target;
* “Tested” means that the assembly code has been tested or otherwise verified to be correct. For
most targets it also means that continuous integration is set up;
* “Callstack” means that the assembly code has been written with due care to support unwinding the
stack and displaying the call frames (i.e. `gdb backtrace` works as expected).
* On platforms marked “available” this library builds and contains necessary functionality to
introspect or manipulate the stack (see the `psm_stack_information` and `psm_stack_manipulation`
macros);
* “Tested” platforms have had their implementations tested or otherwise verified to be correct. For
many such targets it also means that we have a continuous integration setup;
* “Callstack” indicates that, in addition to the library being tested, it has been verified
functions based on stack unwinding (e.g. `gdb backtrace`) continue to work correctly.

<table>

<tr>
<th rowspan="1" colspan="2">Target</th>
<th colspan="3">Support</th>
<th rowspan="1" colspan="2">Target</th> <th colspan="3">Support</th>
</tr>
<tr>
<th rowspan="2">Architecture</th>
Expand Down Expand Up @@ -510,11 +518,9 @@ The assembly code for loongarch64 has been tested locally with a C caller.

# License

PSM is licensed under either of
`psm` is licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
https://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
https://opensource.org/licenses/MIT)
* [Apache License, Version 2.0](<https://www.apache.org/licenses/LICENSE-2.0>)
* [MIT license](<https://opensource.org/licenses/MIT>)

at your option.
34 changes: 10 additions & 24 deletions psm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,16 @@ fn find_assembly(
// is not supported in Windows. For x86_64 the implementation actually works locally,
// but failed tests in CI (???). Might want to have a feature for experimental support
// here.
("x86", _, "windows", _) => {
if masm {
Some(("src/arch/x86_msvc.asm", false))
} else {
Some(("src/arch/x86_windows_gnu.s", false))
}
}
("x86_64", _, "windows", _) => {
if masm {
Some(("src/arch/x86_64_msvc.asm", false))
} else {
Some(("src/arch/x86_64_windows_gnu.s", false))
}
}
("arm", _, "windows", "msvc") => Some(("src/arch/arm_armasm.asm", false)),
("aarch64", _, "windows", _) => {
if masm {
Some(("src/arch/aarch64_armasm.asm", false))
} else {
Some(("src/arch/aarch_aapcs64.s", false))
}
}
("x86", _, _, _) => Some(("src/arch/x86.s", true)),
("x86_64", _, _, _) => Some(("src/arch/x86_64.s", true)),

// ("x86", _, "windows", _) if masm => Some(("src/arch/x86_msvc.asm", true)),
// ("x86", _, "windows", _) => Some(("src/arch/x86_windows_gnu.s", true)),
// ("x86_64", _, "windows", _) if masm => Some(("src/arch/x86_64_msvc.asm", true)),
// ("x86_64", _, "windows", _) => Some(("src/arch/x86_64_windows_gnu.s", true)),
// ("arm", _, "windows", "msvc") => Some(("src/arch/arm_armasm.asm", true)),
("aarch64", _, "windows", _) if masm => Some(("src/arch/aarch64_armasm.asm", true)),
("aarch64", _, "windows", _) => Some(("src/arch/aarch_aapcs64.s", true)),
// ("x86", _, _, _) => Some(("src/arch/x86.s", false)),
// ("x86_64", _, _, _) => Some(("src/arch/x86_64.s", false)),
("arm", _, _, _) => Some(("src/arch/arm_aapcs.s", true)),
("aarch64", _, _, _) => Some(("src/arch/aarch_aapcs64.s", true)),
("powerpc", _, _, _) => Some(("src/arch/powerpc32.s", true)),
Expand Down
52 changes: 0 additions & 52 deletions psm/examples/panics.rs

This file was deleted.

60 changes: 0 additions & 60 deletions psm/examples/thread.rs

This file was deleted.

Loading