-
Notifications
You must be signed in to change notification settings - Fork 166
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
gccrs cannot print the expected filenames #490
Comments
I wonder is there something with binutils/gcc that gives us the expected suffix. What comes to mind is https://cmake.org/cmake/help/v3.0/variable/CMAKE_STATIC_LIBRARY_SUFFIX.html maybe a variable like this exists? @tschwinge @dkm @rguenth @davidmalcolm any suggestions? |
@philberty I confess that I merely hardcoded the extension names in libgccjit (see e.g. jit-tempdir.c's gcc::jit::tempdir::create, e.g. |
Indeed I don't think it exists. There's HOST_EXECUTABLE_SUFFIX, so that's precedent, and collect2 uses SHLIB_SUFFIX |
Cargo expects the host triple in the verbose version output ( |
Adding some additional -print-xyz to the driver would be possible though all the info isn't in any way GCC specific but to the Usually -print-xyz print things that are dependent on configuration or the install location, not something that is fixed Rust must already have a list of valid host/target, how does it determine the suffixes you are looking for? |
That means that the configuration has to be duplicated many times and requires changes to cargo-gccrs every time a new target is added.
Cargo asks rustc as it doesn't have any special knowledge about targets (except for a couple of special cases for things that only exist on macOS, Windows or Emscripten [0]). The target specifications baked into rustc contain this information alongside stuff like data layouts, linker configuration and supported target features. Adding a new target requires changes to rustc anyway, so the prefixes and suffixes are easily added. Adding a new target does not require any changes to Cargo. In addition rustc supports target json specifications, which contain the same info as the builtin target specifications, but stored in an external file. This format is unstable and as such external tools like Cargo can't use them for getting the target info they need. |
rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro
produces the following output
Right now,
gccrs
does not print the expected file names nor does it have the required options.gccrs
also does not understand the concept ofrlib
orproc-macro
The text was updated successfully, but these errors were encountered: