[PATCH] D42511: [WebAssembly] Add support for --gc-sections

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 10:20:20 PST 2018


ruiu added a comment.

In https://reviews.llvm.org/D42511#991998, @sbc100 wrote:

> In https://reviews.llvm.org/D42511#991954, @dschuff wrote:
>
> > I think LLD should probably default to no gc, and in general to minimal/most simple options, and the smarts should be in the driver. I think this matches other targets, and I think it also matches (or at least, should match) the way we have options the frontend/backend vs the driver; i.e. IIRC the driver has logic to pass `-ffunction-sections` and other codegen options to the frontend. So basically all the special logic goes in one place.
>
>
> Ha,  Thats funny, Dan and I came to the exact opposite conclusion.  We decided it was best to put the sensible defaults in the tools in order to (a) keep the command lines shorter (b) keep the driver simpler (c) give direct users of the tools, not via the driver, more sensible defaults.


I think I agree with Sam. As long as options are consistent among toolchain (i.e. --f{function,data}-sections and -gc-sections are both on by default), turning on the gc by default makes sense to me. That option makes sense to wasm because the output size matters a lot for that target.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42511





More information about the llvm-commits mailing list