Conversation
sbc100
left a comment
There was a problem hiding this comment.
Is it possible to split the renaming of the math sources into a separate PR.
Also, it looks like a lot of the Makefile refactoring could be split out? I can't tell which parts of that relate to this change directly.
|
BTW, I'm working an wasm-ld fix that will allow compiler-to be part of LTO too: https://reviews.llvm.org/D71738 :) |
Done, in #151.
I've now split out the main code changes in #152 Assuming those land, when I rebase this PR over them this PR will be just a Makefile change. |
84baf06 to
041d027
Compare
Build and install an LTO version of libc.a and the startup files, alongside the non-LTO versions.
|
The dependencies for this PR all landed, and this PR is now rebased, so it's now just changes to the top-level Makefile to support LTO, and ready for review! |
Makefile
Outdated
| # A directory to install to for "make install". | ||
| INSTALL_DIR ?= /usr/local | ||
| # single or posix | ||
| THREAD_MODEL = single |
There was a problem hiding this comment.
There still seem to be a lot of non-LTO related changes here? Some kind of re-base issue maybe?
There was a problem hiding this comment.
I've now filed #186 to pull out several refactorings.
|
@sunfishcode are you still interested in this? or may i (or someone) take it over? |
|
To avoid duplicate effort: you can apply https://gitlab.haskell.org/ghc/wasi-libc/-/commit/eecc0942af95a90447e6bad8c58d8c133ec82fa2 to Distributing different sysroots both with/without LTO is harder though. |
|
@yamt I'm not actively working on this, so you are welcome to take this over! |
| # which runs after LLVM LTO, so LTO libraries don't satisfy them. They're | ||
| # also relatively uninteresting to LTO, as LLVM recognizes most of them | ||
| # even without seeing their definitions. | ||
| override LIBC_NONLTO_SOURCES = \ |
There was a problem hiding this comment.
@sunfishcode
@sbc100
this exclusion is no longer necessary after https://reviews.llvm.org/D71738, right?
thank you. i guess i will look at full lto first though. as thin lto seems to have more obstacles. |
An old PR which I used as a base: WebAssembly#150 Co-Authored-by: Dan Gohman <dev@sunfishcode.online>
* Add LTO build option An old PR which I used as a base: #150 Co-Authored-by: Dan Gohman <dev@sunfishcode.online> * Exclude atexit.c from LTO This fixes a failure in wasi-sdk "make check". ("undefined symbol: __cxa_atexit" for ctors_dtors.c test) * avoid specifying multiple lto flags for LIBC_NONLTO_OBJS --------- Co-authored-by: Dan Gohman <dev@sunfishcode.online>
Build and install an LTO version of libc.a and the startup files,
alongside the non-LTO versions.
This also adds support for the proposed
__main_argc_argvconvention,supporting compilers both with and without that change.
This doesn't depend on https://reviews.llvm.org/D70700, but contains code that anticipates it.
This does depend on WebAssembly/wasi-sdk#89.