Skip to content

Native CPU is not reported on Raspbian #84890

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
kryptan opened this issue May 4, 2021 · 1 comment
Open

Native CPU is not reported on Raspbian #84890

kryptan opened this issue May 4, 2021 · 1 comment
Labels
A-targets Area: Concerning the implications of different compiler targets C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kryptan
Copy link
Contributor

kryptan commented May 4, 2021

Executing rustc --print target-cpus or rustc -Ctarget-cpu=help on Raspberry Pi 4 prints the following:

Available CPUs for this target:
    arm1020e
    arm1020t
    arm1022e
    ...

In contrast, executing the same command on Windows or Ubuntu on x86-64 also prints native CPU:

Available CPUs for this target:
    native         - Select the CPU of the current host (currently skylake).
    alderlake
    amdfam10
    athlon
    ...

In source code there is check for cross compilation. Native CPU is only printed when not cross compiling:

  printf("Available CPUs for this target:\n");
  if (HostArch == TargetArch) {
    const StringRef HostCPU = sys::getHostCPUName();
    printf("    %-*s - Select the CPU of the current host (currently %.*s).\n",
      MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data());
  }

However I'm not cross compiling. I'm using rust installed from rustup and don't have any additional targets installed.

rustup show:

Default host: armv7-unknown-linux-gnueabihf
rustup home:  /home/pi/.rustup

nightly-armv7-unknown-linux-gnueabihf (default)
rustc 1.54.0-nightly (716394d65 2021-05-03)

lsb_release -a:

No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

rustc --version --verbose:

rustc 1.54.0-nightly (716394d65 2021-05-03)
binary: rustc
commit-hash: 716394d6581b60c75cfdd88b8e5b876f2db88b62
commit-date: 2021-05-03
host: armv7-unknown-linux-gnueabihf
release: 1.54.0-nightly
LLVM version: 12.0.0

Relevant #44393 #44407

@kryptan kryptan added the C-bug Category: This is a bug. label May 4, 2021
@SvenDowideit
Copy link

Is this related to what I hit in rust-rse/reed-solomon-erasure#94 ?

on a coretex-a57 SoftIron overdrive1000 from 2016 ...

# rustc --version --verbose
rustc 1.59.0 (9d1b2106e 2022-02-23)
binary: rustc
commit-hash: 9d1b2106e23b1abd32fce1f17267604a5102f57a
commit-date: 2022-02-23
host: aarch64-unknown-linux-gnu
release: 1.59.0
LLVM version: 13.0.0

@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-targets Area: Concerning the implications of different compiler targets and removed needs-triage-legacy labels Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-targets Area: Concerning the implications of different compiler targets C-bug Category: This is a bug. 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

4 participants