Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can use -flto in cflags for emsdk bazel #148

Open
logankaser opened this issue Mar 2, 2023 · 0 comments
Open

You can use -flto in cflags for emsdk bazel #148

logankaser opened this issue Mar 2, 2023 · 0 comments

Comments

@logankaser
Copy link

I came across this comment while reading your bazel code:
# TODO(PiotrSikora): Add -flto to copts/linkopts when fixed in emsdk.
I just wanted to let you guys know that -flto can be used in clfags just fine.
It does not work for linkopts because emsdk bazel ships a pre-packaged sysroot that does not include lto'd system libs,
but you can still get significant improvements from running lto on your binary.
For a project at my job, it reduced the WASM binary size by half.

Anyway, just wanted to let you all know, cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant