-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix cross-compiling with dlltool for raw-dylib #108355
Conversation
r? @nagisa (rustbot has picked a reviewer for you, use r? to override) |
This will not work when cross-compiling because on Linux there is no |
Well, that's fun. Also means that the original code was broken if cross-compiling from non-Windows for Windows with the same architecture:
|
Thanks a lot for taking this on, @dpaoliello! |
I'd really like us to have proper tests for this before we merge the PR, at least for the cases:
It seems to be straightforward to cross compiling simple libraries as part of a test, as long as the library does not depend on libcore or libstd (which we don't need here). Here's an example for a UI test:
This test will fail if it cannot find and invoke the expected dlltool. However, the downside is that we then would require any system running tests to have The Another thing I noticed is that there might be an additional set of flags needed, as described here: That PR seems to apply them unconditionally (at least on Windows?). Maybe we should add a (run-make) test that does a check as described in the corresponding bug report. |
This test would fail on both CI and on user systems because typically only one toolchain is available in PATH (either i686 or x86_64 or AArch64). |
Even if the host only ever is |
I mean you could only test |
Done.
Ony my local testing it seemed to work - let's see what the CI does...
Good catch - added. |
This comment has been minimized.
This comment has been minimized.
I'm not sure what's going on here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to the CI failure, but there seem to be a few small errors in the Makefile that lead to the test passing without actually testing anything.
Pretty sure the error message doesn't tell the actual executable and just uses hardcoded |
Yes, indeed -- thanks, @mati865! That should be fixable by installing the But this highlights the problem already mentioned before: If we add the test in its current form, everyone who wants to run tests locally will have to install There's precedent for ignoring tests when the environment doesn't fulfill certain requirements (e.g. xLTO tests need Clang). We may have to go down that route if we can't find a more elegant way. |
Ok, here's my workaround: we try to detect if |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…nk-jobs, r=Mark-Simulacrum Limit the number of parallel link jobs during LLVM build for mingw. This PR is an attempt to unblock rust-lang#108355, which keeps failing while trying to link various LLVM artifacts on mingw runners. It looks like doing too many linking jobs might put too much load on the system? (Although I don't understand why the jobs are only failing for rust-lang#108355 while they seem to pass for others) r? infra-ci
…r=Mark-Simulacrum Limit the number of parallel link jobs during LLVM build for mingw. This PR is an attempt to unblock rust-lang/rust#108355, which keeps failing while trying to link various LLVM artifacts on mingw runners. It looks like doing too many linking jobs might put too much load on the system? (Although I don't understand why the jobs are only failing for #108355 while they seem to pass for others) r? infra-ci
⌛ Testing commit 94aaac6c6715291c994643dc59f616ca77a913b6 with merge 2eb6699bd74c7f5b3d1b98907bf4b8dada17997d... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
Looks like i686 dlltool.exe can't produce x64 binaries, so I'm ignoring that target triple in the test for now. |
Thanks, @dpaoliello! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (9a6b0c3): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
…r=Mark-Simulacrum Limit the number of parallel link jobs during LLVM build for mingw. This PR is an attempt to unblock rust-lang/rust#108355, which keeps failing while trying to link various LLVM artifacts on mingw runners. It looks like doing too many linking jobs might put too much load on the system? (Although I don't understand why the jobs are only failing for #108355 while they seem to pass for others) r? infra-ci
…r=Mark-Simulacrum Limit the number of parallel link jobs during LLVM build for mingw. This PR is an attempt to unblock rust-lang/rust#108355, which keeps failing while trying to link various LLVM artifacts on mingw runners. It looks like doing too many linking jobs might put too much load on the system? (Although I don't understand why the jobs are only failing for #108355 while they seem to pass for others) r? infra-ci
Fix for #103939
Issue Details:
When attempting to cross-compile using the
raw-dylib
feature and the GNU toolchain, rustc would attempt to find a cross-compiling version of dlltool (e.g.,i686-w64-mingw32-dlltool
). The has two issues 1) on Windows dlltool is alwaysdlltool
(no cross-compiling named versions exist) and 2) it only supported compiling to i686 and x86_64 resulting in ARM 32 and 64 compiling as x86_64.Fix Details:
dlltool
binary.-m
argument to dlltool to indicate the target machine type.(This is the first of two PRs to fix the remaining issues for the
raw-dylib
feature (#58713) that is blocking stabilization (#104218))