On Wed, Nov 26, 2025 at 6:37 AM John Dallman <[email protected]> wrote:
> I'm linking with -sASSERTIONS=2 -O0, but not getting any assertions going > off. > > https://emscripten.org/docs/porting/Debugging.html says, in the DWARF > section: > > Optimization levels above -O1 or -Og increasingly degrade LLVM debug > information (as with other architectures), and optimization flags at link > time also disable Emscripten’s runtime ASSERTIONS checks. > > > Does -O0 disable ASSERTIONS checks? > > No, it doesn't. You can look at the JS output file to see the extra assertions are emitted for -sASSERTIONS=2. Perhaps diff against a build without that flag. You will see the flag adds stack checks and other things. > I get this warning when linking with, or without -O0: > > em++: warning: running limited binaryen optimizations because DWARF info > requested (or indirectly required) [-Wlimited-postlink-optimizations] > > > Which makes me wonder why binaryen optimisations are being done? > > Check your full link command - you likely have an -O1 or -O2 or such, in addition to the -O0. If that's not it, what is your full link command? > Thanks very much, > > John Dallman > > -- > 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 visit > https://groups.google.com/d/msgid/emscripten-discuss/CAH1xqgke4V%3DvuAOACzm2uf8WgKxQhnS9x4fC3-fLV_mKonZcHQ%40mail.gmail.com > <https://groups.google.com/d/msgid/emscripten-discuss/CAH1xqgke4V%3DvuAOACzm2uf8WgKxQhnS9x4fC3-fLV_mKonZcHQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpTc8RSEnCwtS%3De0Cin_sn7pZ18QTvhbO36NASMsmz1SVg%40mail.gmail.com.
