Commit Graph

16 Commits

Author SHA1 Message Date
Timm Bäder 2f300d34de [clang][driver][wasm] Fix libstdc++ target-dependent include dir
The triple goes after the gcc version, not before. Also add the
/backward version.

Differential Revision: https://reviews.llvm.org/D120251
2022-02-23 14:38:34 +01:00
Timm Bäder b5787a0c6c [clang][driver][wasm] Support -stdlib=libstdc++ for WebAssembly
The WebAssembly toolchain currently supports only -stdlib=libc++
and implicitly assumes the c++ stdlib to be libc++. Change this to also
support libstdc++.

Differential Revision: https://reviews.llvm.org/D117888#3290628
2022-02-03 16:37:52 +01:00
Timm Bäder 3ad6de31c0 [clang][tests] Fix a c++/libc++ -stdlib value typo
"c++" is not usually a valid value for -stdlib.

Differential Revision: https://reviews.llvm.org/D117862
2022-01-24 09:59:20 +01:00
Sam Clegg 818dd8666a [WebAssembly] Modernize include path handling
Move include path construction from
InitHeaderSearch::AddDefaultIncludePaths in the Driver which appears
to be the more modern/correct way of doing things.

Differential Revision: https://reviews.llvm.org/D63030

llvm-svn: 363241
2019-06-13 09:42:43 +00:00
Sam Clegg 582eaca379 [WebAssembly] Cleanup toolchain test files. NFC.
Summary: Split up long lines to improve test readability.

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63081

llvm-svn: 362959
2019-06-10 16:18:04 +00:00
Dan Gohman 0b0d13a704 [WebAssembly] Use the "wasm32-wasi" triple in tests
Similar to https://reviews.llvm.org/D61334, update clang tests to use the
"wasm32-wasi" triple, removing the "-musl" environment and omitting the
"-unknown" vendor.

Differential Revision: https://reviews.llvm.org/D61338

Reviewer: sbc100
llvm-svn: 359630
2019-04-30 23:06:07 +00:00
Sam Clegg fc5ddeeab3 [WebAssembly] Reland of rL356953 (4dcf3acce6)
The previous patch was missing GetProgramPath() in the return value
of getLinkerPath().

See https://reviews.llvm.org/D59743

llvm-svn: 357195
2019-03-28 17:45:18 +00:00
Derek Schuff 039be78791 Revert "[WebAssembly] Don't use default GetLinkerPath"
This reverts commit 4dcf3acce6.
(reverts LLVM SVN r356953)

llvm-svn: 357127
2019-03-27 22:22:18 +00:00
Sam Clegg 4dcf3acce6 [WebAssembly] Don't use default GetLinkerPath
We can't (don't want to) honor the same set of "-fuse-ld" flags with
WebAssembly since the ELF linkers (ld.lld, ld.gnu, etc) don't work with
wasm object files.

Instead we implement our own linker finding logic, similar or other
non-ELF platforms like MSVC.

We've had a few issues with CLANG_DEFAULT_LINKER overriding the
WebAssembly linker which doesn't make sense since there is no generic
linker that can handle WebAssembly today.

Differential Revision: https://reviews.llvm.org/D59743

llvm-svn: 356953
2019-03-25 21:14:26 +00:00
Dan Gohman 788ce374c4 [WebAssembly] COWS has been renamed to WASI.
llvm-svn: 351298
2019-01-16 05:23:57 +00:00
Dan Gohman 055a6f0462 [WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses it
This adds support for multilib paths for wasm32 targets, following
[Debian's Multiarch conventions], and also adds an experimental OS name in
order to test it. 

[Debian's Multiarch conventions]: https://wiki.debian.org/Multiarch/

Differential Revision: https://reviews.llvm.org/D56553

llvm-svn: 351164
2019-01-15 06:58:16 +00:00
Sam Clegg 98dbbfd851 [WebAssembly] Remove use of lld -flavor flag
This flag is deprecated. The preferred way to select the lld
flavor is by calling it by one of its aliases.

Differential Revision: https://reviews.llvm.org/D50395

llvm-svn: 339163
2018-08-07 18:55:41 +00:00
David Greene 8d819a9973 [WebAssembly] Force use of lld for test/Driver/wasm-toolchain.c(pp)
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.

Differential Revision: https://reviews.llvm.org/D49897

llvm-svn: 339158
2018-08-07 17:44:43 +00:00
Sam Clegg 7892ae44b4 [WebAssembly] Don't pass -ffunction-section/-fdata-sections
llvm currently forces both of these to true to passing them
is redundant.

Differential Revision: https://reviews.llvm.org/D37831

llvm-svn: 323897
2018-01-31 18:55:22 +00:00
Douglas Yung 0d29aaf628 Fix test on Windows that was added in r322382.
The test was using "%clang++" which on Windows became "clang.exe++". Use %clangxx instead.

Reviewed by Paul Robinson

llvm-svn: 322417
2018-01-12 22:32:01 +00:00
Sam Clegg ffbfc0f827 [WebAssembly] Support -stdlib=libc++ switch
Referenced implementation from Fuchsia and Darwin Toolchain.
Still only support CST_Libcxx.  Now checks that the argument
is really '-stdlib=libc++', and display error.

Also, now will pass -lc++ and -lc++abi to the linker.

Patch by Patrick Cheng!

Differential Revision: https://reviews.llvm.org/D41937

llvm-svn: 322382
2018-01-12 17:54:49 +00:00