[PATCH] D61452: [WebAssembly] Always include <sysroot>/lib in library path
Dan Gohman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 19 08:37:45 PDT 2019
sunfish added a comment.
> This allows for us to fall back from arch-specific to generic headers as needed. The same can be true of libraries. Not all libraries contains compiled code. `.so` files can also be linker scripts that reference other libraries in which case they can be arch-neutral.
If we add support for implicit linker scripts in wasm-ld, we can look into this. That said, it's not clear we'll want to. They're rare, and when they are used they're another moving part in the middle of a complex system. There are usually other ways to do what they do.
> Secondly, not everyone is going to want to use a multi-arch sysroot. For example I would argue that the wasi SDK would make more sense being single arch since it has exactly one purpose. Its only when installing wasi into an existing system that one really needs to be multi-arch. In any case we should not dictate this.
We're anticipating wasm64. And it's possible WASI could have other triple variants in the future too.
I'm aware some users will sometimes know that they only care about wasm32-wasi. Some of those users may write code, and perhaps some of those that do will share it with others. If such code assumes it can install into $SYSROOT/lib, it may break things for others using a multiarch setup. Unless there are reasons otherwise, it seems valuable to minimize fragmentation between multiarch and non-multiarch users. That seems more valuable than enabling some users to have shorter library paths.
> We've already have one person trying to build a wasi-sdk without using multi-arch paths.
They ended up deciding they misunderstood the project for other reasons and left, so it's unclear what conclusion to draw.
> I'm not sure what you mean by "single arch sysroots are possible either way". The point of a single arch sysroot would be avoid the unnecessary extra path components and I thats exactly what this change is allowing for.
I just mean you can have a multi-arch-style directory tree with a single arch installed in it.
> Thirdly, its what the linux driver does, which is the example we are following of how to build a multi-arch toolchain.
The Linux driver has to stay compatible with existing pre-multi-arch systems; we don't.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits