summary refs log tree commit diff
path: root/src/test/run-pass/c-stack-as-value.rs
AgeCommit message (Collapse)AuthorLines
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-0/+1
This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". --- Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is still getting LLVM bugs fixed to get that working and will take some time. Relatively simple programs all seem to work though! --- It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2016-12-01Fix rust_test_helpers linkage.Vadim Chugunov-1/+1
2015-03-23rustdoc: Replace no-pretty-expanded with pretty-expandedBrian Anderson-0/+2
Now that features must be declared expanded source often does not compile. This adds 'pretty-expanded' to a bunch of test cases that still work.
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-0/+2
2014-06-05mk: Move rust_test_helpers out of libstdAlex Crichton-1/+1
There's no need to distribute these ABI helpers for tests with the standard rust distribution they're only needed for our tests. Closes #2665
2014-04-04Fix fallout from std::libc separationCorey Richardson-1/+1
2013-11-29Statically link librustrt to libstdAlex Crichton-0/+1
This commit alters the build process of the compiler to build a static librustrt.a instead of a dynamic version. This means that we can stop distributing librustrt as well as default linking against it in the compiler. This also means that if you attempt to build rust code without libstd, it will no longer work if there are any landing pads in play. The reason for this is that LLVM and rustc will emit calls to the various upcalls in librustrt used to manage exception handling. In theory we could split librustrt into librustrt and librustupcall. We would then distribute librustupcall and link to it for all programs using landing pads, but I would rather see just one librustrt artifact and simplify the build process. The major benefit of doing this is that building a static rust library for use in embedded situations all of a sudden just became a whole lot more feasible. Closes #3361
2013-10-14Removing ccdeclSteve Klabnik-1/+1
as per https://github.com/mozilla/rust/pull/9606#discussion_r6930872
2013-10-14Remove unused abi attributes.Steve Klabnik-2/+1
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
2013-08-17Fix warnings it testsErick Tryzelaar-5/+1
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-2/+2
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-1/+1
Place `pub` or `priv` on individual items instead.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+4
2013-03-07librustc: Remove "extern mod { ... }" from librustc, librustdoc, and tests. ↵Patrick Walton-3/+5
rs=deexterning
2013-02-01check-fast fallout from removing export, r=burningtreeGraydon Hoare-1/+1
2013-01-30test: Remove export from the tests, language, and libraries. rs=deexportingPatrick Walton-2/+1
2013-01-24librustc: Make C functions unsafePatrick Walton-1/+3
2012-12-10Reliciense makefiles and testsuite. Yup.Graydon Hoare-0/+10
2012-09-21Install new pub/priv/export rules as defaults, old rules accessible under ↵Graydon Hoare-0/+1
#[legacy_exports];
2012-07-17finish fixing broken un-unsupervise windows testsBen Blum-1/+1
2012-07-17Change all test/run-pass uses of rustrt::unsupervise() to something elseBen Blum-2/+2
2012-07-03Switch 'native' to 'extern' (or 'foreign' in some descriptions)Graydon Hoare-1/+1
2011-11-18re-enable tests for #1058 and #1059Niko Matsakis-2/+0
2011-11-16Use attributes for native module ABI and link nameHaitao Li-1/+2
This patch changes how to specify ABI and link name of a native module. Before: native "cdecl" mod llvm = "rustllvm" {...} After: #[abi = "cdecl"] #[link_name = "rustllvm"] native mod llvm {...} The old optional syntax for ABI and link name is no longer supported. Fixes issue #547
2011-11-09Add "cdecl" as synonym for "c-stack-cdecl"Brian Anderson-1/+1
2011-10-24move uses of rust ABI in tests to cdecl or c-stack-cdecl as apprNiko Matsakis-0/+9
Note: I found a bug in c-stack-cdecl which codes not permit such native functions to be used as values. I added an xfail-test (c-stack-as-value) documenting it.