rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.96k stars 12.53k forks source link

Bad value for `target-cpu` has spammy and confusing error output #90894

Open lopopolo opened 2 years ago

lopopolo commented 2 years ago

This same error spam reproduces if using an intentionally bad target, like RUSTFLAGS='-C target-cpu=xxx-todo'.

`fn main() {}

on x86_64 macOS.

compiling with:

rustc main.rs -Ctarget-cpu=cortex-a75

The current output is:

'cortex-a75' is not a recognized processor for this target (ignoring processor)
'cortex-a75' is not a recognized processor for this target (ignoring processor)
'cortex-a75' is not a recognized processor for this target (ignoring processor)
'cortex-a75' is not a recognized processor for this target (ignoring processor)
'cortex-a75' is not a recognized processor for this target (ignoring processor)
<cut>
```console $ rustc main.rs -Ctarget-cpu=cortex-a75 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! error: could not compile `bitflags` 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) libc++abi: Pure virtual function called! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) 'cortex-a75' is not a recognized processor for this target (ignoring processor) LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! error: build failed ```

Ideally the output should look like:

something less spammy.

meta

$ rustc -Vv
rustc 1.56.1 (59eed8a2a 2021-11-01)
binary: rustc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-apple-darwin
release: 1.56.1
LLVM version: 13.0.0

background

I accidentally copy-and-pasted the RUSTFLAGS example for -C target-cpu= from https://rust-lang.github.io/packed_simd/perf-guide/target-feature/rustflags.html#target-cpu in an attempt to compile for target-cpu=native.

It looks like x86_64 Darwin doesn't like the cortex-a75 CPU type and I got a lot of unexpected output before the build errored out in LLVM.

Noratrieb commented 1 year ago
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
warning: unknown feature specified for `-Ctarget-feature`: `uwu`
  |
  = note: it is still passed through to the codegen backend
  = help: consider filing a feature request

'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
'+uwu' is not a recognized feature for this target (ignoring feature)
warning: 1 warning emitted

target features have the same effect

Noratrieb commented 1 year ago

trying with target-cpu i get similar spam but not just that, i also get UB in LLVM!

'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target' (ignoring processor)
+uwu' is not a recognized processor for this target' (ignoring processor)
+uwu'' is not a recognized processor for this target+uwu (ignoring processor)
' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
'+uwu' is not a recognized processor for this target (ignoring processor)
LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it!
'+uwu' is not a recognized processor for this target (ignoring processor)
pure virtual method called
terminate called without an active exception
fish: Job 1, 'rustc +stable -Ctarget-cpu=+uwu…' terminated by signal SIGABRT (Abort)

it's unreliable. sometimes everything is fine, sometimes it aborts and sometimes it segfaults.