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

Migrate branch-protection-check-IBT to rmake.rs #134760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Dec 25, 2024

  • The Makefile version never ran because of Makefile syntax confusion because ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64) compares x86 to x86_64, which always evaluates to false.
  • The test would've always failed because precompiled std is not built with -Z cf-protection=branch, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std.
  • Thus, the test input file is instead changed to a no_std program.

The GNU property note was added by #110304 in order to address #103001.

Partially supersedes #129156.
The rmake.rs port was initially authored by @Rejyr in #126720.
This PR is co-authored with @Oneirical and @Rejyr.

r? @bjorn3 or reroll

try-job: x86_64-msvc
try-job: x86_64-apple-1
try-job: x86_64-apple-2

- The Makefile version *never* ran because of Makefile syntax confusion.
- The test would've always failed because precompiled std is not built
  with `-Z cf-protection=branch`, but linkers require all input object
  files to indicate IBT support in order to enable IBT for the
  executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` program.

Co-authored-by: Jerry Wang <[email protected]>
Co-authored-by: Oneirical <[email protected]>
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 25, 2024
@jieyouxu jieyouxu added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 25, 2024
@jieyouxu

This comment was marked as outdated.

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 25, 2024
…eck-IBT, r=<try>

Migrate `branch-protection-check-IBT` to rmake.rs

- The Makefile version *never* ran because of Makefile syntax confusion because `ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64)` [compares `x86` to `x86_64`, which always evaluates to false](rust-lang#126720 (comment)).
- The test would've always failed because precompiled std is not built with `-Z cf-protection=branch`, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` program.

The GNU property note was added by rust-lang#110304 in order to address rust-lang#103001.

Partially supersedes rust-lang#129156.
The rmake.rs port was initially authored by `@Rejyr` in rust-lang#126720.
This PR is co-authored with `@Oneirical` and `@Rejyr.`

r? `@bjorn3` or reroll

try-job: x86_64-msvc
try-job: x86_64-apple
@bors

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as off-topic.

@jieyouxu
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 25, 2024

⌛ Trying commit 5871cee with merge a90422e...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 25, 2024
…eck-IBT, r=<try>

Migrate `branch-protection-check-IBT` to rmake.rs

- The Makefile version *never* ran because of Makefile syntax confusion because `ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64)` [compares `x86` to `x86_64`, which always evaluates to false](rust-lang#126720 (comment)).
- The test would've always failed because precompiled std is not built with `-Z cf-protection=branch`, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` program.

The GNU property note was added by rust-lang#110304 in order to address rust-lang#103001.

Partially supersedes rust-lang#129156.
The rmake.rs port was initially authored by `@Rejyr` in rust-lang#126720.
This PR is co-authored with `@Oneirical` and `@Rejyr.`

r? `@bjorn3` or reroll

try-job: x86_64-msvc
try-job: x86_64-apple-1
try-job: x86_64-apple-2
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-apple-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Updating files:  98% (49952/50971)
Updating files:  99% (50462/50971)
Updating files: 100% (50971/50971)
Updating files: 100% (50971/50971), done.
Switched to a new branch 'try'
branch 'try' set up to track 'origin/try'.
[command]/usr/local/bin/git log -1 --format=%H
a90422e9f391d8fefbcca172431f106605a0d41c
##[group]Run src/ci/scripts/setup-environment.sh
src/ci/scripts/setup-environment.sh
---
file:.git/config remote.origin.url=https://github.com/rust-lang-ci/rust
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config gc.auto=0
file:.git/config http.https://github.com/.extraheader=AUTHORIZATION: basic ***
file:.git/config branch.try.remote=origin
file:.git/config branch.try.merge=refs/heads/try
file:.git/config remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
file:.git/config submodule.library/backtrace.active=true
file:.git/config submodule.library/backtrace.url=https://github.com/rust-lang/backtrace-rs.git
file:.git/config submodule.library/stdarch.active=true
---
---- [run-make] tests/run-make/branch-protection-check-IBT stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/run-make/branch-protection-check-IBT/rmake_out" && env -u RUSTFLAGS AR="ar" CARGO="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2-tools-bin/cargo" CC="/Users/runner/work/rust/rust/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin/clang" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-apple-macosx10.12" CXX="/Users/runner/work/rust/rust/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin/clang++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-apple-macosx10.12 -stdlib=libc++" DYLD_LIBRARY_PATH="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0-bootstrap-tools/x86_64-apple-darwin/release/deps:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0/lib:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2-tools-bin:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib" HOST_RPATH_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/lib" LD_LIB_PATH_ENVVAR="DYLD_LIBRARY_PATH" LLVM_BIN_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen codegendata codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/bin/FileCheck" NODE="/usr/local/bin/node" PYTHON="/usr/bin/python3" RUSTC="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/bin/rustc" RUSTDOC="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/bin/rustdoc" SOURCE_ROOT="/Users/runner/work/rust/rust" TARGET="x86_64-apple-darwin" TARGET_RPATH_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib" TARGET_RPATH_ENV="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/run-make/branch-protection-check-IBT/rmake_out:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0-bootstrap-tools/x86_64-apple-darwin/release/deps:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0/lib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/run-make/branch-protection-check-IBT/rmake"
--- stderr -------------------------------
command failed at line 50
command failed at line 50
Command { cmd: DYLD_LIBRARY_PATH="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/run-make/branch-protection-check-IBT/rmake_out:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/lib:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0-bootstrap-tools/x86_64-apple-darwin/release/deps:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0/lib:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2-tools-bin:/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/bin/rustc" "main.rs" "--target=x86_64-unknown-linux-gnu" "-Cpanic=abort" "-Zcf-protection=branch" "-Clink-args=-nostartfiles" "-Csave-temps", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage2/bin/rustc", defused: true, armed_location: Location { file: "/Users/runner/work/rust/rust/tests/run-make/branch-protection-check-IBT/rmake.rs", line: 43, col: 5 } }, already_executed: true }
output status: `exit status: 1`
=== STDOUT ===


=== STDERR ===
error[E0463]: can't find crate for `core`

@bors
Copy link
Contributor

bors commented Dec 25, 2024

💔 Test failed - checks-actions

@jieyouxu
Copy link
Member Author

... Right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants