This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Force use of lld for test/Driver/wasm-toolchain.c(pp)
ClosedPublic

Authored by greened on Jul 26 2018, 7:08 PM.

Details

Summary

lld is the only supported linker that works for WebAssembly, so ensure clang is using it for this test. This gets the tests passing when configuring clang to use a different linker by default.

Diff Detail

Repository
rC Clang

Event Timeline

greened created this revision.Jul 26 2018, 7:08 PM

How do you configure clang to use a different linker? It looks like getDefaultLinker() is hardcoded, but maybe I'm missing something.

How do you configure clang to use a different linker? It looks like getDefaultLinker() is hardcoded, but maybe I'm missing something.

I pass -fuse-ld in the test RUN lines.

But in the CL description you say "..when configuring clang to use a different linker by default". How is this possible? i.e. do you have a config where these tests are currently failing?

But in the CL description you say "..when configuring clang to use a different linker by default". How is this possible? i.e. do you have a config where these tests are currently failing?

Yes, I do. I configured with -DCLANG_DEFAULT_LINKER=gold.

sbc100 accepted this revision.Aug 7 2018, 9:42 AM

I see. This seems a little strange to me. I'm not sure it makes sense for CLANG_DEFAULT_LINKER to effect targets like WebAssembly that only have single supported linker. I'm OK with landing this now but I think we might need to look into a better solution.

This revision is now accepted and ready to land.Aug 7 2018, 9:42 AM
This revision was automatically updated to reflect the committed changes.