Skip to content

Commit fc2eb47

Browse files
committed
Test some additional targets with -Zbuild-std
1 parent 2a33d25 commit fc2eb47

File tree

3 files changed

+53
-26
lines changed

3 files changed

+53
-26
lines changed

.github/workflows/psm.yml

+41-13
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ jobs:
2020
os: [ubuntu-latest, windows-latest, macOS-latest]
2121
timeout-minutes: 10
2222
steps:
23-
- uses: actions/checkout@v1
23+
- uses: actions/checkout@v2
2424
- name: Install Rust ${{ matrix.rust_toolchain }}
2525
uses: actions-rs/toolchain@v1
2626
with:
2727
toolchain: ${{ matrix.rust_toolchain }}
28+
profile: minimal
2829
default: true
2930
- name: Update
3031
uses: actions-rs/cargo@v1
@@ -68,11 +69,12 @@ jobs:
6869
# Only 64 bit GCC is preinstalled
6970
#- i686-pc-windows-gnu
7071
steps:
71-
- uses: actions/checkout@v1
72+
- uses: actions/checkout@v2
7273
- name: Install Rust nightly
7374
uses: actions-rs/toolchain@v1
7475
with:
7576
toolchain: ${{ matrix.rust_toolchain }}
77+
profile: minimal
7678
target: ${{ matrix.rust_target }}
7779
default: true
7880
# https://github.com/rust-lang/rust/issues/49078
@@ -115,11 +117,12 @@ jobs:
115117
- x86_64-unknown-linux-musl
116118
timeout-minutes: 10
117119
steps:
118-
- uses: actions/checkout@v1
120+
- uses: actions/checkout@v2
119121
- name: Install Rust nightly
120122
uses: actions-rs/toolchain@v1
121123
with:
122124
toolchain: nightly
125+
profile: minimal
123126
target: ${{ matrix.rust_target }}
124127
default: true
125128
- name: Update
@@ -176,22 +179,16 @@ jobs:
176179
#
177180
# Currently tested manually on real hardware.
178181
- sparc64-unknown-linux-gnu
179-
#
180-
# Not even a distribution exists that supports 32-bit SPARC...
181-
# - sparc-unknown-linux-gnu
182-
#
183-
# No Rustc for the target exists
184-
# - sparcv9-sun-solaris
185-
#
186182
# BSDs: could be tested with full system emulation
187183
- x86_64-unknown-netbsd
188184
timeout-minutes: 10
189185
steps:
190-
- uses: actions/checkout@v1
186+
- uses: actions/checkout@v2
191187
- name: Install Rust nightly
192188
uses: actions-rs/toolchain@v1
193189
with:
194190
toolchain: nightly
191+
profile: minimal
195192
target: ${{ matrix.rust_target }}
196193
default: true
197194
- name: Update
@@ -217,11 +214,12 @@ jobs:
217214
- x86_64-unknown-freebsd
218215
timeout-minutes: 10
219216
steps:
220-
- uses: actions/checkout@v1
217+
- uses: actions/checkout@v2
221218
- name: Install Rust nightly
222219
uses: actions-rs/toolchain@v1
223220
with:
224221
toolchain: nightly
222+
profile: minimal
225223
target: ${{ matrix.rust_target }}
226224
default: true
227225
- name: Update
@@ -246,11 +244,12 @@ jobs:
246244
- x86_64-apple-ios
247245
timeout-minutes: 10
248246
steps:
249-
- uses: actions/checkout@v1
247+
- uses: actions/checkout@v2
250248
- name: Install Rust ${{ matrix.rust_toolchain }}
251249
uses: actions-rs/toolchain@v1
252250
with:
253251
toolchain: ${{ matrix.rust_toolchain }}
252+
profile: minimal
254253
target: ${{ matrix.rust_target }}
255254
default: true
256255
- name: Update
@@ -263,3 +262,32 @@ jobs:
263262
with:
264263
command: build
265264
args: --target=${{ matrix.rust_target }} --manifest-path=psm/Cargo.toml
265+
266+
cross-build-without-std:
267+
runs-on: ubuntu-latest
268+
strategy:
269+
fail-fast: false
270+
matrix:
271+
rust_target:
272+
- wasm32-wasi
273+
# cannot be built because cross-toolchains are not easily available and LLVM fails
274+
# generating code when building libcore anyway...?
275+
# - sparcv9-sun-solaris
276+
# - sparc-unknown-linux-gnu
277+
timeout-minutes: 10
278+
steps:
279+
- uses: actions/checkout@v2
280+
- name: Install Rust nightly
281+
uses: actions-rs/toolchain@v1
282+
with:
283+
toolchain: nightly
284+
profile: minimal
285+
default: true
286+
- name: Fix-up toolchain
287+
run: |
288+
rustup component add rust-src --toolchain nightly --target ${{ matrix.rust_target }}
289+
- name: Build ${{ matrix.rust_target }}
290+
uses: actions-rs/cargo@v1
291+
with:
292+
command: build
293+
args: --target ${{ matrix.rust_target }} --manifest-path=psm/Cargo.toml -Zbuild-std=core

.github/workflows/stacker.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
os: [ubuntu-latest, windows-latest, macOS-latest]
2020
timeout-minutes: 10
2121
steps:
22-
- uses: actions/checkout@v1
22+
- uses: actions/checkout@v2
2323
- name: Install Rust ${{ matrix.rust_toolchain }}
2424
uses: actions-rs/toolchain@v1
2525
with:
2626
toolchain: ${{ matrix.rust_toolchain }}
27+
profile: minimal
2728
default: true
2829
- name: Build
2930
uses: actions-rs/cargo@v1
@@ -50,11 +51,12 @@ jobs:
5051
# Only 64 bit GCC is preinstalled
5152
#- i686-pc-windows-gnu
5253
steps:
53-
- uses: actions/checkout@v1
54+
- uses: actions/checkout@v2
5455
- name: Install Rust nightly
5556
uses: actions-rs/toolchain@v1
5657
with:
5758
toolchain: ${{ matrix.rust_toolchain }}
59+
profile: minimal
5860
target: ${{ matrix.rust_target }}
5961
default: true
6062
# https://github.com/rust-lang/rust/issues/49078
@@ -97,11 +99,12 @@ jobs:
9799
- x86_64-unknown-linux-musl
98100
timeout-minutes: 10
99101
steps:
100-
- uses: actions/checkout@v1
102+
- uses: actions/checkout@v2
101103
- name: Install Rust nightly
102104
uses: actions-rs/toolchain@v1
103105
with:
104106
toolchain: nightly
107+
profile: minimal
105108
target: ${{ matrix.rust_target }}
106109
default: true
107110
- name: Build
@@ -141,24 +144,19 @@ jobs:
141144
#
142145
# Currently tested manually on real hardware.
143146
- sparc64-unknown-linux-gnu
144-
#
145-
# Not even a distribution exists that supports 32-bit SPARC...
146-
# - sparc-unknown-linux-gnu
147-
#
148-
# No Rustc for the target exists
149-
# - sparcv9-sun-solaris
150-
151147
# BSDs: could be tested with full system emulation
152148
- i686-unknown-freebsd
153149
- x86_64-unknown-freebsd
154150
- x86_64-unknown-netbsd
151+
- wasm32-wasi
155152
timeout-minutes: 10
156153
steps:
157-
- uses: actions/checkout@v1
154+
- uses: actions/checkout@v2
158155
- name: Install Rust nightly
159156
uses: actions-rs/toolchain@v1
160157
with:
161158
toolchain: nightly
159+
profile: minimal
162160
target: ${{ matrix.rust_target }}
163161
default: true
164162
- uses: actions-rs/cargo@v1
@@ -178,11 +176,12 @@ jobs:
178176
- x86_64-apple-ios
179177
timeout-minutes: 10
180178
steps:
181-
- uses: actions/checkout@v1
179+
- uses: actions/checkout@v2
182180
- name: Install Rust ${{ matrix.rust_toolchain }}
183181
uses: actions-rs/toolchain@v1
184182
with:
185183
toolchain: ${{ matrix.rust_toolchain }}
184+
profile: minimal
186185
target: ${{ matrix.rust_target }}
187186
default: true
188187
- uses: actions-rs/cargo@v1

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ psm_stack_information! (
8686
#[inline(always)]
8787
fn current_stack_ptr() -> usize {
8888
unsafe {
89-
let mut x = std::mem::MaybeUninit::uninit();
89+
let mut x = std::mem::MaybeUninit::<u8>::uninit();
9090
// Unlikely to be ever exercised. As a fallback we execute a volatile read to a
9191
// local (to hopefully defeat the optimisations that would make this local a static
9292
// global) and take its address. This way we get a very approximate address of the

0 commit comments

Comments
 (0)