diff --git a/ChangeLog.md b/ChangeLog.md index ca7589f96dcf..1aefaa012635 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -24,6 +24,10 @@ Current Trunk producer's section in debug builds, you can remove it a tool like `wasm-opt --strip-producers` (which is what Emscripten still does in release builds, as always) or use `llvm-objcopy`. +- Only strip debug info in release builds + when `-g` is not present. Previously + even in an `-O0` build without `-g` we would strip it. This was not documented + behavior, and has no effect on program behavior, but may be noticeable + if you inspect a build output with `-O0`. - Do not remove `__original_main` using `--inline-main`. We used to do this so that it didn't show up in stack traces (which could be confusing because it is added by the linker - it's not in the source code). But this has had diff --git a/emcc.py b/emcc.py index 226fcd6c61aa..9ee4062f244d 100755 --- a/emcc.py +++ b/emcc.py @@ -601,9 +601,9 @@ def backend_binaryen_passes(): # hardcoded value in the binaryen pass) if shared.Settings.OPT_LEVEL > 0 and shared.Settings.GLOBAL_BASE >= 1024: passes += ['--low-memory-unused'] - if shared.Settings.DEBUG_LEVEL < 3: - passes += ['--strip-debug'] if shared.Settings.OPT_LEVEL > 0: + if shared.Settings.DEBUG_LEVEL < 3: + passes += ['--strip-debug'] if not shared.Settings.EMIT_PRODUCERS_SECTION: passes += ['--strip-producers'] if shared.Settings.AUTODEBUG: