-
Notifications
You must be signed in to change notification settings - Fork 44
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
crux-mir
: Support cross-compiling libs to wasm32
target
#1147
Conversation
- Refactor translate_libs.sh a bit to get all the components of the target triple - Only pass x86_64 simd flags to memchr when on x86_64 - Add dlmalloc library required for non-emscripten wasm32 std
Hmm it seems like there is a reference to an apparently now-nonexistent flag |
Bummer, I completely missed that |
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.
Thanks, @qsctr! This mostly looks reasonable, although I would request that you add some additional documentation so that when we next update the rustc
toolchain that crux-mir
supports, we have some reminders about why dlmalloc
needs to be included. (It's easy to overlook this sort of thing otherwise.)
@@ -0,0 +1,43 @@ | |||
[package] | |||
name = "dlmalloc" | |||
version = "0.2.3" |
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.
Is this exactly the same as the upstream version of dlmalloc-0.2.3
, or did you have to apply any patches to make it work with mir-json
/crux-mir
? If you did have to patch it, it would be worth putting a high-level description of the changes in crux-mir/lib/Patches.md
.
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.
Yes it is exactly the same, no patches are required.
What's the best place to put this? Is the comment in |
Also, should we test a |
Short answer: Yes, I think that is likely good enough for now. Long answer: The Ultimately, we never checked in the generator script, but I kind of wish that we did, since that script would be a good place to document things such as the inclusion of If we had a proper generator script that documented all of these quirks, I think the likelihood of dropping |
Perhaps so, although I wonder how much we should actually do. For instance, have you run the |
I don't think it's easy to run the test suite with |
OK. In that case, I agree that a simple CI action that simply runs |
translate_libs.sh
script to specify a cross-compile targetmemchr
build when supporteddlmalloc
lib, which is required for buildingstd
onwasm32-unknown-unknown
. Copied from https://github.com/alexcrichton/dlmalloc-rs/tree/0.2.3