Skip to content

-Zindirect-branch-cs-prefix on top of -Zretpoline* #140740

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ojeda
Copy link
Contributor

@ojeda ojeda commented May 7, 2025

Cc: @azhogin @Darksonn

This goes on top of #135927, i.e. please skip the first commit here. Please feel free to inherit it there.

In fact, I am not sure if there is any use case for the flag without -Zretpoline*. GCC and Clang allow it, though.

There is a FIXME for two ignores in the test that I took from another test I did in the past -- they may be needed or not here since I didn't run the full CI. Either way, it is not critical.

Tracking issue: #116852.
MCP: rust-lang/compiler-team#868.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 7, 2025
@ojeda ojeda force-pushed the indirect-branch-cs-prefix branch from 4422b3c to 0582d8f Compare May 7, 2025 14:07
@ojeda ojeda force-pushed the indirect-branch-cs-prefix branch from 0582d8f to b0392c5 Compare May 7, 2025 14:16
@ojeda
Copy link
Contributor Author

ojeda commented May 7, 2025

@rustbot label F-target_modifiers A-rust-for-linux

@rustbot rustbot added A-rust-for-linux Relevant for the Rust-for-Linux project F-target_modifiers `#![feature(target_modifiers)]` labels May 7, 2025
@rust-log-analyzer

This comment has been minimized.

@ojeda
Copy link
Contributor Author

ojeda commented May 7, 2025

The error is related to the base PR -- I think this one should be clean (modulo the marked ignore-*s) when that one is.

@ojeda ojeda force-pushed the indirect-branch-cs-prefix branch from b0392c5 to f395de3 Compare May 7, 2025 15:01
@rust-log-analyzer

This comment has been minimized.

@ojeda ojeda force-pushed the indirect-branch-cs-prefix branch from f395de3 to a79ff99 Compare May 7, 2025 17:15
@rust-log-analyzer

This comment has been minimized.

azhogin and others added 4 commits May 8, 2025 19:08
This is intended to be used for Linux kernel RETPOLINE builds.

Signed-off-by: Miguel Ojeda <[email protected]>
…iers) to enable retpoline-related target features
@ojeda ojeda force-pushed the indirect-branch-cs-prefix branch from a79ff99 to 879a3bc Compare May 8, 2025 17:09
@rustbot rustbot added the A-rustdoc-json Area: Rustdoc JSON backend label May 8, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#18 exporting to docker image format
#18 sending tarball 20.2s done
#18 DONE 33.2s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
failures:

---- [ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature3 stdout ----

error in revision `by_feature3`: /checkout/tests/ui/target-feature/retpoline-target-feature-flag.rs:?: unexpected WARN: '?:?: ?:?: target feature `retpoline-indirect-calls` cannot be enabled with `-Ctarget-feature`: use `retpoline` target modifier flag instead'

error in revision `by_feature3`: 1 unexpected errors found, 0 expected errors not found
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/target-feature/retpoline-target-feature-flag.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--cfg" "by_feature3" "--check-cfg" "cfg(test,FALSE,by_flag,by_feature1,by_feature2,by_feature3)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/retpoline-target-feature-flag.by_feature3" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target=x86_64-unknown-linux-gnu" "--crate-type=lib" "-Ctarget-feature=+retpoline-indirect-calls"

--- unexpected errors (from JSON output) ---
WARNline   ?: ?:?: ?:?: target feature `retpoline-indirect-calls` cannot be enabled with `-Ctarget-feature`: use `retpoline` target modifier flag instead
---

thread '[ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature3' panicked at src/tools/compiletest/src/runtest.rs:790:13:
errors differ from expected

---- [ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature2 stdout ----

error in revision `by_feature2`: /checkout/tests/ui/target-feature/retpoline-target-feature-flag.rs:?: unexpected WARN: '?:?: ?:?: target feature `retpoline-indirect-branches` cannot be enabled with `-Ctarget-feature`: use `retpoline` target modifier flag instead'

error in revision `by_feature2`: 1 unexpected errors found, 0 expected errors not found
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/target-feature/retpoline-target-feature-flag.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--cfg" "by_feature2" "--check-cfg" "cfg(test,FALSE,by_flag,by_feature1,by_feature2,by_feature3)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/retpoline-target-feature-flag.by_feature2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target=x86_64-unknown-linux-gnu" "--crate-type=lib" "-Ctarget-feature=+retpoline-indirect-branches"

--- unexpected errors (from JSON output) ---
WARNline   ?: ?:?: ?:?: target feature `retpoline-indirect-branches` cannot be enabled with `-Ctarget-feature`: use `retpoline` target modifier flag instead
---

thread '[ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature2' panicked at src/tools/compiletest/src/runtest.rs:790:13:
errors differ from expected

---- [ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature1 stdout ----

error in revision `by_feature1`: /checkout/tests/ui/target-feature/retpoline-target-feature-flag.rs:?: unexpected WARN: '?:?: ?:?: target feature `retpoline-external-thunk` cannot be enabled with `-Ctarget-feature`: use `retpoline-external-thunk` target modifier flag instead'

error in revision `by_feature1`: 1 unexpected errors found, 0 expected errors not found
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/target-feature/retpoline-target-feature-flag.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--cfg" "by_feature1" "--check-cfg" "cfg(test,FALSE,by_flag,by_feature1,by_feature2,by_feature3)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/target-feature/retpoline-target-feature-flag.by_feature1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target=x86_64-unknown-linux-gnu" "--crate-type=lib" "-Ctarget-feature=+retpoline-external-thunk"

--- unexpected errors (from JSON output) ---
WARNline   ?: ?:?: ?:?: target feature `retpoline-external-thunk` cannot be enabled with `-Ctarget-feature`: use `retpoline-external-thunk` target modifier flag instead
---

thread '[ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature1' panicked at src/tools/compiletest/src/runtest.rs:790:13:
errors differ from expected


failures:
    [ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature3
    [ui] tests/ui/target-feature/retpoline-target-feature-flag.rs#by_feature2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust-for-linux Relevant for the Rust-for-Linux project A-rustdoc-json Area: Rustdoc JSON backend F-target_modifiers `#![feature(target_modifiers)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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