-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ci: aarch64-gnu-debug job #131207
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
Merged
Merged
ci: aarch64-gnu-debug job #131207
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
make \ | ||
ninja-build \ | ||
file \ | ||
curl \ | ||
ca-certificates \ | ||
python3 \ | ||
python3-dev \ | ||
libxml2-dev \ | ||
libncurses-dev \ | ||
libedit-dev \ | ||
swig \ | ||
doxygen \ | ||
git \ | ||
cmake \ | ||
sudo \ | ||
gdb \ | ||
libssl-dev \ | ||
pkg-config \ | ||
xz-utils \ | ||
lld \ | ||
clang \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY scripts/sccache.sh /scripts/ | ||
RUN sh /scripts/sccache.sh | ||
|
||
ENV RUSTBUILD_FORCE_CLANG_BASED_TESTS 1 | ||
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1 | ||
|
||
# llvm.use-linker conflicts with downloading CI LLVM | ||
ENV NO_DOWNLOAD_CI_LLVM 1 | ||
|
||
ENV RUST_CONFIGURE_ARGS \ | ||
--build=aarch64-unknown-linux-gnu \ | ||
--enable-debug \ | ||
--enable-lld \ | ||
--set llvm.use-linker=lld \ | ||
--set target.aarch64-unknown-linux-gnu.linker=clang \ | ||
--set target.aarch64-unknown-linux-gnu.cc=clang \ | ||
--set target.aarch64-unknown-linux-gnu.cxx=clang++ | ||
|
||
# This job appears to be checking two separate things: | ||
# - That we can build the compiler with `--enable-debug` | ||
# (without necessarily testing the result). | ||
# - That the tests with `//@ needs-force-clang-based-tests` pass, since they | ||
# don't run by default unless RUSTBUILD_FORCE_CLANG_BASED_TESTS is set. | ||
# - FIXME(https://github.com/rust-lang/rust/pull/126155#issuecomment-2156314273): | ||
# Currently we only run the subset of tests with "clang" in their name. | ||
# - See also FIXME(#132034) | ||
|
||
ENV SCRIPT \ | ||
python3 ../x.py --stage 2 build && \ | ||
python3 ../x.py --stage 2 test tests/run-make --test-args clang | ||
davidtwco marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/run-make/pointer-auth-link-with-c-lto-clang/rmake.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// `-Z branch protection` is an unstable compiler feature which adds pointer-authentication | ||
// code (PAC), a useful hashing measure for verifying that pointers have not been modified. | ||
// This test checks that compilation and execution is successful when this feature is activated, | ||
// with some of its possible extra arguments (bti, pac-ret, leaf) when doing LTO. | ||
// See https://github.com/rust-lang/rust/pull/88354 | ||
|
||
//@ needs-force-clang-based-tests | ||
//@ only-aarch64 | ||
// Reason: branch protection is not supported on other architectures | ||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
use run_make_support::{clang, env_var, llvm_ar, run, rustc, static_lib_name}; | ||
|
||
fn main() { | ||
clang() | ||
.arg("-v") | ||
.lto("thin") | ||
.arg("-mbranch-protection=bti+pac-ret+leaf") | ||
.arg("-O2") | ||
.arg("-c") | ||
.out_exe("test.o") | ||
.input("test.c") | ||
.run(); | ||
llvm_ar().obj_to_ar().output_input(static_lib_name("test"), "test.o").run(); | ||
rustc() | ||
.linker_plugin_lto("on") | ||
.opt_level("2") | ||
.linker(&env_var("CLANG")) | ||
.link_arg("-fuse-ld=lld") | ||
.arg("-Zbranch-protection=bti,pac-ret,leaf") | ||
.input("test.rs") | ||
.output("test.bin") | ||
.run(); | ||
run("test.bin"); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
int foo() { return 0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#[link(name = "test")] | ||
extern "C" { | ||
fn foo() -> i32; | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
foo(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.