Skip to content

Commit

Permalink
initial bug discovery (ref rust-lang/cargo#9406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Jan 1, 2024
0 parents commit ce99e0c
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[workspace]
members = [
"plat-win",
"plat-linux"
]
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all:
RUST_BACKTRACE=full cargo build -Zbuild-std --target="x86_64-unknown-none"
3 changes: 3 additions & 0 deletions corelib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[package]
name = "corelib"
version = "0.0.0"
3 changes: 3 additions & 0 deletions corelib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn number() -> usize {
42
}
9 changes: 9 additions & 0 deletions plat-linux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cargo-features = ["per-package-target"]

[package]
name = "plat-linux"
version = "0.0.0"
forced-target = "x86_64-unknown-linux-gnu.json"

[dependencies]
corelib = { path = "../corelib" }
4 changes: 4 additions & 0 deletions plat-linux/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
println!("Hello, linux. Your number is {}", corelib::number())
}

9 changes: 9 additions & 0 deletions plat-win/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cargo-features = ["per-package-target"]

[package]
name = "plat-win"
version = "0.0.0"
forced-target = "x86_64-pc-windows-gnu"

[dependencies]
corelib = { path = "../corelib" }
3 changes: 3 additions & 0 deletions plat-win/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, windows. Your number is {}", corelib::number())
}
5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
channel = "nightly-2024-01-01"
components = [ "rustfmt", "rustc-dev", "clippy", "rust-src", "llvm-tools-preview" ]
targets = [ "x86_64-unknown-linux-gnu", "x86_64-pc-windows-gnu", "x86_64-unknown-none" ]
profile = "minimal"
48 changes: 48 additions & 0 deletions x86_64-unknown-linux-gnu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"arch": "x86_64",
"cpu": "x86-64",
"crt-static-respected": true,
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
"dynamic-linking": true,
"env": "gnu",
"has-rpath": true,
"has-thread-local": true,
"llvm-target": "x86_64-unknown-linux-gnu",
"max-atomic-width": 64,
"os": "linux",
"plt-by-default": false,
"position-independent-executables": true,
"pre-link-args": {
"gcc": [
"-m64"
]
},
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
16,
0,
0
]
},
"static-position-independent-executables": true,
"supported-sanitizers": [
"address",
"cfi",
"leak",
"memory",
"thread",
"safestack"
],
"supported-split-debuginfo": [
"packed",
"unpacked",
"off"
],
"supports-xray": true,
"target-family": [
"unix"
],
"target-pointer-width": "64"
}

0 comments on commit ce99e0c

Please sign in to comment.