-
Notifications
You must be signed in to change notification settings - Fork 824
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
feat(c-api) Implement cross-compilation API in C #2072
Conversation
…wasm_cpu_features_t`.
0fa667a
to
169fe16
Compare
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.
Looks pretty good overall
let mut builder = ObjectFile::headless(); | ||
|
||
if let Some(target) = config.target { | ||
builder = builder.target(target.inner); |
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.
Does it make sense to set the target for a headless-only engine?
It's fine for symmetry I suppose but I don't think this can ever do anything
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.
Yeah I was wondering if that was making sense. Using the target makes sense only when compiling, but we never know, maybe one day, someone, somewhere… :-p. Let's keep it for “the symmetry” as you said, how does it sound?
builder = builder.target(target.inner); | ||
} | ||
|
||
Arc::new(builder.engine()) |
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.
These ones too
cpu_features: Option<&mut wasm_cpu_features_t>, | ||
feature: Option<&wasm_name_t>, |
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.
I don't think we need Option
around all user-supplied pointers, the standard wasm-c-api doesn't bother with that in a lot of cases, if the pointer is invalid it'll crash or do what C does
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.
Yeah but I prefer to prevent bad usage of our API. That's what we already do everywhere almost.
bors r+ |
bors r- waiting on #2083 to finish |
Canceled. |
bors r+ |
Description
Depends on #2071 (merged).
This patch implements
wasm_target_t
,wasm_triple_t
,wasm_cpu_features_t
.This patch also implements
wasm_config_set_target
to set… awasm_target_t
. Thewasm_config_new_with_engine
function has been updated to handle the newwasm_target_t
.Example
Review