Skip to content

minicore doesn't propagate -Ctarget-cpu for targets that require target-cpu being specified #140038

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

Open
jieyouxu opened this issue Apr 19, 2025 · 0 comments
Labels
A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-bug Category: This is a bug. 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.

Comments

@jieyouxu
Copy link
Member

Example test:

//! Check that certain target *requires* the user to specify a target CPU via `-C target-cpu`.

//@ add-core-stubs

//@ revisions: amdgcn_nocpu amdgcn_cpu

//@[amdgcn_nocpu] compile-flags: --target=amdgcn-amd-amdhsa
//@[amdgcn_nocpu] needs-llvm-components: amdgpu
//@[amdgcn_nocpu] build-fail

//@[amdgcn_cpu] compile-flags: --target=amdgcn-amd-amdhsa
//@[amdgcn_cpu] needs-llvm-components: amdgpu
//@[amdgcn_cpu] compile-flags: -Ctarget-cpu=gfx900
//@[amdgcn_cpu] build-pass

//@ revisions: avr_nocpu avr_cpu
//@[avr_nocpu] compile-flags: --target=avr-none
//@[avr_nocpu] needs-llvm-components: avr
//@[avr_nocpu] build-fail

//@[avr_cpu] compile-flags: --target=avr-none
//@[avr_cpu] needs-llvm-components: avr
//@[avr_cpu] compile-flags: -Ctarget-cpu=atmega328p
//@[avr_cpu] build-pass

#![crate_type = "rlib"]

// NOTE: this can't use `minicore` yet because `minicore` doesn't currently propagate the `-C
// target-cpu` for targets that *require* a `target-cpu` being specified.
#![feature(no_core)]
#![no_core]

extern crate minicore;

pub fn foo() {}

//[amdgcn_nocpu,avr_nocpu]~? ERROR target requires explicitly specifying a cpu with `-C target-cpu`
@jieyouxu jieyouxu added A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-bug Category: This is a bug. 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 Apr 19, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 19, 2025
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-test-infra Area: test infrastructure (may span bootstrap/compiletest/more) C-bug Category: This is a bug. 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

No branches or pull requests

2 participants