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!
--
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 emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTHC%3DRz2UZrqLBBaPQ0ROT4JXGA7RnH5iDEsLeUdvRmMA%40mail.gmail.com.
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 emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CA%2B_KjGY3dNhQ4rZmmmaGLyChG7qTKPaO6i2-Au0Xqd15D5Jr0g%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 emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/b3fc0d3b-5668-4d5c-acbf-4cb23bca1e82%40googlegroups.com.
Ok, I understand better.
What makes things confusing is probably more that the usual
distinction between compiler flags and linker flags are a bit
blurred in Emscripten.
As "WASM_OBJECT_FILES=0" is doing the same as "-flto", but also
applying it to system libs, maybe it would be cleaner to have it
replaced by a "-s ENABLE_SYSTEM_LIBS_LTO=1" that would only focus
on enabling LTO on the system libs (letting the user control the
LTO of its own code with the usual -flto flag).
Btw, the docs mention that --lvm-lto might have the values 1,2 or
3 => is this still applicable to the new Wasm backend ? I guess
no (?)
Cheers,
Gabriel
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRXtK1wYBfm27dqgALwr2oHMZLE4QeU7rN1KKEugfORfg%40mail.gmail.com.
Thanks for the feedback John!1. First thing I'd make sure is that all source files and libraries are built with the new version. Mixing object files between versions can lead to link errors.If it's not that, then looks like that symbol should arrive from libcompiler_rt. Looking in EMCC_DEBUG=1 output during link can show which libs it decides to link in. Is compiler-rt not there? It should always be linked in, unless overridden by EMCC_ONLY_FORCED_STDLIBS, I believe. (If you are using that option, then you need to include all necessary libs, and the list does change by the backend, I believe.)
2. "is not a function" is probably a bad function pointer call. Building with --profiling might show a useful stack trace. But this may just be a bug in wasm2js, if the same optimization level works in wasm output in the new backend. If you can provide a testcase that would be good.
- Alon
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/24154c49-5529-af52-1319-c0cd47ccb242%40gmail.com.
Ok, I understand better.
What makes things confusing is probably more that the usual distinction between compiler flags and linker flags are a bit blurred in Emscripten.
As "WASM_OBJECT_FILES=0" is doing the same as "-flto", but also applying it to system libs, maybe it would be cleaner to have it replaced by a "-s ENABLE_SYSTEM_LIBS_LTO=1" that would only focus on enabling LTO on the system libs (letting the user control the LTO of its own code with the usual -flto flag).
Btw, the docs mention that --lvm-lto might have the values 1,2 or 3 => is this still applicable to the new Wasm backend ? I guess no (?)
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/24154c49-5529-af52-1319-c0cd47ccb242%40gmail.com.
This is a good point, actually. Before, almost all of the emscripten-specific flags only mattered at link time, and now there are probably several that also matter at compile time. We should probably take a pass over the docs and figure that out, or else just declare that everything should also go at compile time.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAAEAhvckhm4szfJzz61wa7jMAHyDfbhozjDw8-GFCXa3dh4R%3Dw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTOyCC%2BF0i7zrQNPFWW3nFim7c%3DntgUxKU4uPhbHs3NKg%40mail.gmail.com.
Well, to me, having such hint in the settings.js file (= compile time flag or link time flag) would certainly help to make things cleaner while porting existing program.
While I do agree the "simple and safe" method of passing everything at both compile/link time is convenient, the issue is that having to recompile a full 5000+ CPP files program just because of a tweak in a flag that is only expected to be used at link time is... argh :)
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTOyCC%2BF0i7zrQNPFWW3nFim7c%3DntgUxKU4uPhbHs3NKg%40mail.gmail.com.
So far, the settings.js flag I identified that do have an impact at compilation time are:
- STRICT=1 (as it change some defined symbols)
- DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR
- All the ports flags, USE_<portname> (as it change the system include paths)
- and possibly USE_WASM_OBJECT_FILES, though it look like -flto is doing the same (USE_WASM_OBJECT_FILES may only be used at link time to trigger LTO on system libs)
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpQiJxYXY-ZtZUQ7ucwXooYxthUmZbw%3Dw8eVJH%2BGCYWeCw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/06d628c8-627e-5dba-6a39-22044c269d57%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CA%2B_KjGZ6_ALMYGdpKFJN4Cps6g59%2By0a038xz-gkD6cBjwxe0w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpSSCO7iDCoiDxjM%2BkxWik54cr%3DwGpkhge60_8q5-BWxOQ%40mail.gmail.com.