summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/wasm-toolchain.c
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] -fwasm-exceptions enables reference-typesHeejin Ahn2019-11-131-2/+8
| | | | | | | | | | | | | | | Summary: This adds `-mreference-types` and `-mno-reference-types` flags to clang and make `-fwasm-exceptions` enables reference types feature in clang and the backend. Reviewers: tlively Subscribers: dschuff, sbc100, jgravelle-google, sunfish, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69832
* [WebAssembly] -pthread implies -target-feature +sign-extThomas Lively2019-10-181-2/+8
| | | | | | | | | | | | | | | | | Summary: The sign extension proposal was motivated by a desire to not have separate sign-extending atomic operations, so it is meant to be enabled when threads are used. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69075 llvm-svn: 375199
* [WebAssembly] Add -fwasm-exceptions for wasm EHHeejin Ahn2019-09-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds `-fwasm-exceptions` (in similar fashion with `-fdwarf-exceptions` or `-fsjlj-exceptions`) that turns on everything with wasm exception handling from the frontend to the backend. We currently have `-mexception-handling` in clang frontend, but this is only about the architecture capability and does not turn on other necessary options such as the exception model in the backend. (This can be turned on with `llc -exception-model=wasm`, but llc is not invoked separately as a command line tool, so this option has to be transferred from clang.) Turning on `-fwasm-exceptions` in clang also turns on `-mexception-handling` if not specified, and will error out if `-mno-exception-handling` is specified. Reviewers: dschuff, tlively, sbc100 Subscribers: aprantl, jgravelle-google, sunfish, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67208 llvm-svn: 371708
* [WebAssembly] Make pthread imply bulk-memory, mutable-globalsThomas Lively2019-07-121-2/+14
| | | | | | | | | | | | | | | | | Summary: This paves the way for using passive segments in pthread builds, which will make separate memory files unnecessary. Mutable globals are also necessary for the upcoming implementation of TLS. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64586 llvm-svn: 365935
* [WebAssembly] Implement Address Sanitizer for EmscriptenGuanzhong Chen2019-06-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This diff enables address sanitizer on Emscripten. On Emscripten, real memory starts at the value passed to --global-base. All memory before this is used as shadow memory, and thus the shadow mapping function is simply dividing by 8. Reviewers: tlively, aheejin, sbc100 Reviewed By: sbc100 Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63742 llvm-svn: 364468
* [WebAssembly] Cleanup toolchain test files. NFC.Sam Clegg2019-06-101-9/+20
| | | | | | | | | | | | 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
* [WebAssembly] Use the "wasm32-wasi" triple in testsDan Gohman2019-04-301-6/+6
| | | | | | | | | | | 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
* [WebAssembly] Reland of rL356953 (4dcf3acce6)Sam Clegg2019-03-281-4/+4
| | | | | | | | | The previous patch was missing GetProgramPath() in the return value of getLinkerPath(). See https://reviews.llvm.org/D59743 llvm-svn: 357195
* Revert "[WebAssembly] Don't use default GetLinkerPath"Derek Schuff2019-03-271-4/+4
| | | | | | | This reverts commit 4dcf3acce6d7455fd079d8e57441906ca2bad254. (reverts LLVM SVN r356953) llvm-svn: 357127
* [WebAssembly] Don't use default GetLinkerPathSam Clegg2019-03-251-4/+4
| | | | | | | | | | | | | | | | | 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
* [WebAssembly] Fix test/Driver/wasm-toolchain.c in the presence of ↵Sam Clegg2019-03-241-1/+1
| | | | | | | | CLANG_DEFAULT_LINKER This was broken in rL356817 (See https://reviews.llvm.org/D59721) llvm-svn: 356847
* [WebAssembly] Make driver -pthread imply linker --shared-memoryThomas Lively2019-03-221-1/+2
| | | | | | | | | | | | | | | | Summary: This eliminates a linker error the user might otherwise see about how using the 'atomics' feature requires --shared-memory. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59721 llvm-svn: 356817
* [WebAssembly] Temporarily disable bulk-memory with -pthreadThomas Lively2019-03-021-10/+2
| | | | | | | | | | | | | | | | | | | Summary: To prevent the instability of bulk-memory in the wasm backend from blocking separate pthread testing, temporarily remove the logic that adds -mbulk-memory in the presence of -pthread. Since browsers will ship bulk memory before or alongside threads, this change will be reverted as soon as bulk memory has stabilized in the backend. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58854 llvm-svn: 355248
* [WebAssembly] Remove uses of ThreadModelThomas Lively2019-02-281-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the clang UI, replaces -mthread-model posix with -matomics as the source of truth on threading. In the backend, replaces -thread-model=posix with the atomics target feature, which is now collected on the WebAssemblyTargetMachine along with all other used features. These collected features will also be used to emit the target features section in the future. The default configuration for the backend is thread-model=posix and no atomics, which was previously an invalid configuration. This change makes the default valid because the thread model is ignored. A side effect of this change is that objects are never emitted with passive segments. It will instead be up to the linker to decide whether sections should be active or passive based on whether atomics are used in the final link. Reviewers: aheejin, sbc100, dschuff Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, steven_wu, dexonsmith, rupprecht, jfb, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D58742 llvm-svn: 355112
* [WebAssembly] Make thread-related options consistentHeejin Ahn2019-02-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There have been three options related to threads and users had to set all three of them separately to get the correct compilation results. This makes sure the relationship between the options makes sense and sets necessary options for users if only part of the necessary options are specified. This does: - Remove `-matomics`; this option alone does not enable anything, so removed it to not confuse users. - `-mthread-model posix` sets `-target-feature +atomics` - `-pthread` sets both `-target-feature +atomics` and `-mthread-model posix` Also errors out when explicitly given options don't match, such as `-pthread` is given with `-mthread-model single`. Reviewers: dschuff, sbc100, tlively, sunfish Subscribers: jgravelle-google, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57874 llvm-svn: 353761
* [WebAssembly] COWS has been renamed to WASI.Dan Gohman2019-01-161-6/+6
| | | | llvm-svn: 351298
* [WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses itDan Gohman2019-01-151-2/+19
| | | | | | | | | | | | 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
* [WebAssembly] Remove use of lld -flavor flagSam Clegg2018-08-071-4/+4
| | | | | | | | | 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
* [WebAssembly] Force use of lld for test/Driver/wasm-toolchain.c(pp)David Greene2018-08-071-2/+2
| | | | | | | | | | 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
* [WebAssembly] Don't pass -ffunction-section/-fdata-sectionsSam Clegg2018-01-311-15/+2
| | | | | | | | | llvm currently forces both of these to true to passing them is redundant. Differential Revision: https://reviews.llvm.org/D37831 llvm-svn: 323897
* [WebAssembly] Remove `-allow-undefined-file wasm.syms` from linker argsSam Clegg2018-01-111-2/+2
| | | | | | | | See: https://github.com/WebAssembly/tool-conventions/issues/35 Differential Revision: https://reviews.llvm.org/D41923 llvm-svn: 322321
* [WebAssembly] Add crt1.o with calling lldSam Clegg2017-10-271-2/+2
| | | | | | | | | Also, for OS unknown targets like wasm, don't include 'unknown' in the library path. This is a fix for rL316719. Differential Revision: https://reviews.llvm.org/D39354 llvm-svn: 316777
* Fix test/Driver/wasm-toolchain.c on windowsSam Clegg2017-10-271-2/+2
| | | | llvm-svn: 316725
* [WebAssembly] Include libclang_rt.builtins in the standard waySam Clegg2017-10-271-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D39218 llvm-svn: 316719
* [WebAssembly] Fix wasm-toolchain.c testsSam Clegg2017-09-141-11/+3
| | | | | | | | | | Summary: This test should have been updated in r313299 Subscribers: jfb, dschuff, jgravelle-google, aheejin Differential Revision: https://reviews.llvm.org/D37873 llvm-svn: 313307
* [WebAssembly] Add default -allow-undefined-file to linker argsSam Clegg2017-06-231-3/+3
| | | | | | | | | | | Also, don't use the outdated lib32/lib64 naming of files within the sysroot. The more modern/flexible approach IIUC is to use seperate sysroots or /lib/<target-tripple> and /include/<target-tripple>. Differential Revision: https://reviews.llvm.org/D33565 llvm-svn: 306074
* [WebAssembly] Fix failing wasm-toolchain testSam Clegg2017-05-091-3/+3
| | | | | | | | This test was broken in r302558. Differential Revision: https://reviews.llvm.org/D33015 llvm-svn: 302569
* [WebAssembly] Initial driver support for standard library paths.Dan Gohman2016-02-221-6/+6
| | | | llvm-svn: 261560
* [WebAssembly] Fix a typo in a comment.Dan Gohman2016-01-111-1/+1
| | | | llvm-svn: 257327
* Add missing -no-canonical-prefixes.Daniel Jasper2016-01-071-1/+1
| | | | llvm-svn: 257057
* [WebAssembly] Add a test to ensure that -fvisibility=default works.Dan Gohman2016-01-071-0/+6
| | | | | | It should override the default of -fvisibility=hidden. llvm-svn: 257007
* [WebAssembly] Enable -fvisibility=hidden by default.Dan Gohman2016-01-071-3/+6
| | | | | | | This, along with many things in the WebAssembly target, is experimental. Feedback is welcome. llvm-svn: 257006
* [WebAssembly] Enable -ffunction-sections and -fdata-sections by default.Dan Gohman2016-01-071-1/+13
| | | | | | | These remain user-overridable with -fno-function-sections and -fno-data-sections. llvm-svn: 257005
* [WebAssembly] Only enable --gc-sections when optimizations are enabled.Dan Gohman2016-01-071-3/+23
| | | | | | | Also, revamp the wasm-toolchain.c test and add a test to ensure that a user-supplied --no-gc-sections comes after --gc-sections. llvm-svn: 257004
* [WebAssembly] Add --gc-sections to the link line.Dan Gohman2016-01-061-1/+1
| | | | | | | | This will eventually be accompanied with a change to enable -ffunction-sections and -fdata-sections by default, which is currently delayed by some development process issues. llvm-svn: 256967
* Make wasm-toolchain.c test pass on Windows.Nico Weber2015-12-221-1/+1
| | | | llvm-svn: 256286
* Use -no-canonical-prefixes to make sure binaries names are easier to match.Eric Christopher2015-12-221-1/+1
| | | | llvm-svn: 256228
* [WebAssembly] Remove the -target command-line flag from the ld commandline.Dan Gohman2015-12-211-0/+3
This flag isn't needed, or permitted, with the "ld" flavor of lld. Also, add a basic ld commandline test. llvm-svn: 256216
OpenPOWER on IntegriCloud