[PATCH] D62443: [WebAssembly] Move Emscripten-specific behavior under a --emscripten flag

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 15:03:57 PDT 2019


sunfish added a comment.

In D62443#1525418 <https://reviews.llvm.org/D62443#1525418>, @sbc100 wrote:

> I have proposed https://reviews.llvm.org/D62744 which covers most of the changes here.
>
> For `-pie/-shared` I'd rather not add a `--emscripten` flag.  In fact I'd rather not have such a flag at all.    Some background that might help here:  The PIC support in LLVM conforms to  the (admittedly unstable/experimental) spec specified in  https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.  Note that this document includes both the "emscripten" way of doing things and the future "Planned Changes" way of doing things which is implemented in LLVM.     emscripten-wasm-finalize, which is part of binaryen, then converts from the LLVM/official ABI to the emscripten ABI for dynamic linking.   I will update the docs to be more clear but as I see it non of the PIC support in LLVM is emscripten-specific.


I agree that the design isn't necessarily specific to Emscripten. My concern is that it seems to have some limitations, which I've been assuming mean that we'd want to design a new system when it comes time to add dynamic linking outside of Emscripten anyway. I've commented on other issues about the specific concerns, so we can follow up there.

> If you really want to add a new flag I'd be OK with "--experimental".. but I'd rather not have either.  Have you been experiencing issues with people passing `-pie/-shared` this flag and getting unexpected results?

Yes, we have reports both of people using -Wl,--shared and having things not work, and of people compiling with -fPIC and having things not work. These are what prompted me to write this patch and the LLVM one.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62443/new/

https://reviews.llvm.org/D62443





More information about the llvm-commits mailing list