-
Notifications
You must be signed in to change notification settings - Fork 459
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
Default to llvm-ar when compiling for wasm. #657
Conversation
3a8213e
to
1dd32c3
Compare
|
On a related note one can wonder if it would be appropriate to extend this approach beyond a clang-specific default. Most notably gcc also recognizes |
f4a60f6
to
81bf238
Compare
Sorry but I don't think I have the energy to shepherd and merge this change. The I don't know of anything specifically wrong with this patch, but maintaining this crate for long enough has shown to me that even if issues can't immediately be seen they're likely still lurking unfortunately. If this can be done in a way that's opt-in or something like that I would be more ok merging because the risk would be much lower. |
That's unfortunate:-( For reference, the suggestion is a generalization of a problem with wasm target. While Before I close this, a question. Would it be helpful to open an issue and challenge clang users to provide feedback if builds with Cheers. |
Unfortunately, at least in my experience, I don't know how to get feedback on a change like this. There's so many ways that C build systems are configured in my experience all you can really do is push the change, see what breaks, and evaulate it if it's worth it to back out or not. That's not a great way of managing this however. If you wanted to make this specific to the wasm target though that seems reasonable to me. Making this more targeted that can theoretically get generalized in the future but not necessarily immediately seems plausible. I don't think this crate is as heavily used with wasm and AFAIK all wasm C compilation goes through clang right now with a pretty well-defined set of compilers. |
81bf238
to
a1faddd
Compare
Adjusted accordingly.
Like for the next major release when possible breakage can be tolerated. There are more cleanups that one can implement... |
Sorry but I've decided that the current development trajectory of |
a1faddd
to
82dcb68
Compare
In addition I default to llvm-lib in clang-cl compilations. This is an alternative to #668. |
82dcb68
to
8a2cf55
Compare
8a2cf55
to
bbd2aff
Compare
bbd2aff
to
dfbc4a4
Compare
Just in case, as for o-wasm label. It's actually two-part now, wasm and Windows. And as discussed in the commentary, it's possible to make a case for extending the approach, defaulting to llvm-ar, to all clang compilations. And even to gcc (arguably less error-prone than recent gcc-ar changes:-). There is only one potential problem with the latter. gcc for Windows doesn't seem to enforce UTF-8 in |
dfbc4a4
to
e13b8b6
Compare
Could you separate the Windows |
e13b8b6
to
239b632
Compare
Back from draft, now as wasm-only thing. Just in case for reference. As it stands now, the linking procedure (on non-emscripten wasm targets) fails with "archive has no index" in .a file generated by cc-rs. This modification resolves the problem. |
239b632
to
f9b17af
Compare
Re-based just in case. |
Generalization of the method would facilitate cases when system ar(1) doesn't support any given cross-compile target. This is because accompanying llvm-ar is known to match targets supported by the clang installation at hand.
f9b17af
to
5407eaf
Compare
Re-based. To recap. The problem is that the linking procedure (on non-emscripten wasm targets) fails with "archive has no index" in .a file generated by cc-rs. For completeness sake one can note that Rust 1.67 doesn't seem to require the index, presumably at the cost of longer linking times. Just in case. One can dispute the placement of the suggested |
Though moving would entail restructuring of the |
On a tangential note, yet in favour of this suggestion;-) The first |
This fixes the |
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.
This seems fine to me, especially since it's localized to wasm.
Defaulting to llvm-ar facilitates cases when system ar(1) doesn't
support any given cross-compile target. This is because accompanying
llvm-ar is known to match targets supported by the clang installation
at hand.