In this case, the compiler is generating LLVM bitcode files which don't say what optimization flags were used so there isn't something for the linker to compare against. It is also legitimate to use differing optimization flags for compilation and linking. It is also possible (and with Emscripten common) to use different optimization flags for different files in the compilation phase. An example of that is that -Oz is used on the libcxx sources that are built and stored in the cache.
I agree with Chad though that defaults could be better. I have had to spend a lot of time trying to sort out what flags to use... - Bruce Sent from my iPhone > On Feb 17, 2015, at 3:48 PM, Clifford Wolf <[email protected]> wrote: > >> On Tuesday, February 17, 2015 at 9:41:20 AM UTC+1, Chad Austin wrote: >> No worries. :) As with any human factors/tooling problem, if a smart >> person with good intentions encounters a bug or usability pitfall, it's >> likely dozens or hundreds of other people will too... Perhaps the compiler >> could do a better job reducing the number of JavaScript variables even >> without a -O flag? > > I don't think that this would be necessary. But a check in the linker that > sees if link-time optimizations and compile-time optimization match (and > produce a warning if they don't) would have helped a lot. I can imagine that > this is a common problem as you usually don't pass options like -O to the > linker, so Makefiles have to be changed and things can go wrong. (Also: In > many cases there might not be an observable problem with the generated code > (other than slow code execution and big output files) and the user might just > incorrectly assume that all available optimization was used.) > -- > 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]. > For more options, visit https://groups.google.com/d/optout. -- 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]. For more options, visit https://groups.google.com/d/optout.
