Description
The target-cpus feature is only exposed when building llvm through x.py
because it depends on a patch in our fork of llvm. As a result, linking to an upstream llvm build with llvm.llvm-config = "..."
won't work with --print=target-cpus
. The relevant patch on the current branch is rust-lang/llvm-project@a8f170c; it would be nice if someone lobbied for that in upstream LLVM.
The last attempt to do that was https://reviews.llvm.org/D93789; the feedback there was to use fillValidCPUArchList() instead.
See below for the original issue description.
Hi,
is there a good reason release versions of rust do not support these options?
% rustc --print target-cpus
Target CPU help is not supported by this LLVM version.
% rustc --print target-spec-json
error: the `-Z unstable-options` flag must also be passed to enable the target-spec-json print option
OK, so let's try adding that option, then:
% rustc -Z unstable-options --print target-spec-json
error: the option `Z` is only accepted on the nightly compiler
Gah!
Googling a little gave a sliver of hope:
% rustc +nightly -Z unstable-options --print target-spec-json
error: the option `Z` is only accepted on the nightly compiler
%
Nope!
% rustc --version
rustc 1.65.0
% uname
NetBSD
% uname -m
amd64
% uname -p
x86_64
% uname -r
9.99.104
%
It does, though support rustc --print target-list
, so this looks a little ... inconsistent?
The rustc(1)
man page does mention both the above unsupported options without
any qualification.
I suspect this can relatively easily (and cheaply?) be improved?