This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Add `--extra-features` flag to add addional features
ClosedPublic

Authored by sbc100 on Oct 12 2022, 4:58 PM.

Details

Summary

This flag acts just like the existing --features flag but instead
of replacing the set of inferred features it adds to it.

This is useful for example if you want to --export a mutable global
but none of the input of object were built with mutable global support.
In that case you can do --extra-features=mutable-globals to avoid the
linker error that would otherwise be generated in this case:

wasm-ld: error: mutable global exported but 'mutable-globals' feature not present in inputs: __stack_pointer. Use --no-check-features to suppress.

Diff Detail

Event Timeline

sbc100 created this revision.Oct 12 2022, 4:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 4:58 PM
Herald added subscribers: pmatos, asb, wingo and 4 others. · View Herald Transcript
sbc100 requested review of this revision.Oct 12 2022, 4:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 4:58 PM
sbc100 updated this revision to Diff 467306.Oct 12 2022, 4:59 PM
  • revert part
tlively accepted this revision.Oct 13 2022, 9:10 AM

It seems kind of strange to have features be free form strings rather than a set of flags, but maybe that's appropriate at this stage. It's certainly more flexible.

This revision is now accepted and ready to land.Oct 13 2022, 9:10 AM

It seems kind of strange to have features be free form strings rather than a set of flags, but maybe that's appropriate at this stage. It's certainly more flexible.

But that direction was already taken with the existing --features= flag right? I'm not adding that concept here.

It seems kind of strange to have features be free form strings rather than a set of flags, but maybe that's appropriate at this stage. It's certainly more flexible.

But that direction was already taken with the existing --features= flag right? I'm not adding that concept here.

Ah right, I forgot about that flag.