Thats a really great question.   Right now having all of those options
is confusing and I don't even know which ones make sense.   I think
that ultimately for the wasm backend we will want to have `-flto` be
the flag that enables this, to match the existing flag in upstream
clang and the other flags be removed.   I've got a very old PR that
starts to move in that direction:
https://github.com/emscripten-core/emscripten/pull/7961.

I thought we had a bug open to address this already but I can't find
it now.  Feel free to open one if you feel motivated.

On Tue, Oct 22, 2019 at 2:40 AM Gabriel Cuvillier
<[email protected]> wrote:
>
> Great!
>
> A question regarding this in the documentation, which confuses me a bit:
>
> You can disable wasm object files with -s WASM_OBJECT_FILES=0, which will 
> make the wasm backend behave more like fastcomp.
> Neither fastcomp nor the wasm backend without wasm object files will run the 
> LLVM optimization passes by default, even if using LLVM IR in object files;
> for that you must pass --llvm-lto 1.
>
> With the 3 options "-s WASM_OBJECT_FILES=0", "--llvm-lto 1", and "-flto", 
> there is a lot of combinations possible and the outcome is not quite clear.
>
> So, on the Wasm backed, what's the difference between doing (or what is 
> meaningful/meaningless):
>     -flto
>   --llvm-lto 1
>   -s WASM_OBJECT_FILES=0
>   -flto --llvm-lto 1
>   -flto -s WASM_OBJECT_FILES=0
>   -flto -s WASM_OBJECT_FILES=0 --llvm-lto 1
>   -s WASM_OBJECT_FILES=0 --llvm-lto 1
>
> + Which option shall be passed at compilation time / at link time ?
>
> Thanks!
>
> Le 22/10/2019 à 00:17, Alon Zakai a écrit :
>
> Hello everyone,
>
> The emsdk will now install the upstream LLVM backend by default, instead of 
> fastcomp, as of
>
> https://github.com/emscripten-core/emsdk/pull/373
>
> That is, if you install/activate "latest" then you get the same as 
> "latest-upstream". It used to be an alias for "latest-fastcomp".
>
> You can still use "latest-fastcomp" to get fastcomp if you need that. You can 
> also install stuff like "1.39.0-fastcomp", a version with a specific backend.
>
> The emsdk defaults to the upstream backend from 1.39.0, but not earlier 
> versions, as the upstream backend wasn't stable enough yet at those times. 
> (But you can as always do "1.38.39-upstream" to get upstream for those 
> versions.) In other words, the only thing that changed now is that for 1.39.0 
> and onwards, if you don't specify the backend, you'll get upstream.
>
> We are changing the default now after a long period of recommending people 
> upgrade to the LLVM backend and fixing issues based on their feedback, as a 
> result of which at this point we feel comfortable changing the default.
>
> Please test and file bugs if you find any! All you need to do is update to 
> the latest emsdk master from github, and
>
> ./emsdk install latest
> ./emsdk activate latest
>
> If this is your first time using the upstream backend, see the list of 
> differences,
>
> https://emscripten.org/docs/compiling/WebAssembly.html#backends
>
> Our goal is to remove fastcomp eventually, and it is now officially 
> deprecated, but we will only start to plan that after seeing the feedback 
> from users after this switch.
>
> - Alon
>
> --
> You received this message because you are subscribed to the Google Groups 
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTHC%3DRz2UZrqLBBaPQ0ROT4JXGA7RnH5iDEsLeUdvRmMA%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/emscripten-discuss/06858de5-a732-0e70-6ce7-e60c1a9e2667%40gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28drcY6k3xwEckZuUVGfvAMXCAHT9bT3gE7jdVXO-uP2g%40mail.gmail.com.

Reply via email to