-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Upstream support for --print=target-cpus
to LLVM
#104785
Comments
The If the rustc and llvm build you're using are provided by the operating system's package manager then it likely is a stable version and won't support nightly features. In that case you should report the lack of target-cpus support to netbsd. |
Hm. I had the impression that
Yes, that would be nice to farm that question over to someone else to solve. However, the package manager for rust on NetBSD is presently ... me, and I do this alone in my "copious" spare time. We package releases. Therefore the question whether there is a good reason this functionality is turned off in the release versions. I still think it looks ... inconsistent with both itself (since |
The target-list feature is only exposed when building llvm through the rust build tools. Most likely because it depends on a patch in our fork of llvm. So if you're linking to an upstream llvm build it won't work. |
Ah, that invalidates my assumption that this would be "easy, cheap". Thanks for the explanation. I have a knob I can turn to turn on the build & use of the rust-internal LLVM, and it's presently turned off. I may return with a pull request to the man page... |
Some linux distros ship a rustup package. You could add the system-rustc as toolchain to a preinstalled rustup so it can be selected as |
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. |
@cuviper The last attempt to do that was https://reviews.llvm.org/D93789. The feedback there was to use fillValidCPUArchList() instead. |
Rustup is a program that serves as a Rust toolchain manager. It is used to retrieve various versions of the Rust toolchain. It has been extended with specific features to serve the interests of package managers before and more could be added. EDIT: Oops, I repeated what people said previously.Most notably, however, its existing features include being able to link arbitrary rustcs on the system with various aliases. Thus it not only makes sense for a distro to package rustup and expose it to the user actually running the OS, it may make sense to then go further to package a rustc, and have the rustup link it with a name like "distro", so that the user could install nightly and stable and whatnot, and build scripts could use the distro version of rustc and cargo via |
I'm going to repurpose this to track upstreaming |
target-cpus
, no target-spec-json
)--print=target-cpus
to LLVM
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 withllvm.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?
OK, so let's try adding that option, then:
Gah!
Googling a little gave a sliver of hope:
Nope!
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 withoutany qualification.
I suspect this can relatively easily (and cheaply?) be improved?
The text was updated successfully, but these errors were encountered: