Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working asmjs and wasm targets #36339

Merged
merged 27 commits into from
Oct 1, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
939bd47
Configure LLVM to use js backend
badboy Aug 6, 2016
cb3f579
Make the jsbackend an optional component
badboy Aug 6, 2016
86fd661
Patch panic_unwind to compile, but this is surely broken
badboy Aug 6, 2016
1231ce3
Support emscripten in rustbuild
brson Aug 30, 2016
c62d8b1
Update gcc-rs for emscripten
brson Aug 31, 2016
ad9184c
Adapting bootstrap to run tests on asmjs.
rschulman Sep 5, 2016
b2dfeac
Adding ignore-emscripten to failing tests.
rschulman Sep 6, 2016
b8b50f0
Preliminary wasm32 support
brson Sep 6, 2016
f41b363
Update libtest for single-threaded emscripten support
brson Sep 6, 2016
fcd3279
Improve bootstrap crate testing for emscripten
brson Sep 6, 2016
9c4a01e
Ignore lots and lots of std tests on emscripten
brson Sep 7, 2016
00e377c
Ignore all debuginfo tests on emscripten
brson Sep 7, 2016
10a52d5
Update LLVM with fastcomp patches
brson Sep 7, 2016
37abec0
Tidy
brson Sep 8, 2016
183b2dd
Ignore entire test modules on emscripten instead of individual tests
brson Sep 14, 2016
a4c3288
Change the sigs of set_print/set_panic to allow restoring the default…
brson Sep 14, 2016
8401e37
Update bootstrap and compiletest to use the detected nodejs
brson Sep 15, 2016
7c0bf41
Ignore another emscripten test because missing intrinsics
brson Sep 16, 2016
525a798
Rewrite emscripten unwinding to use libcxx
brson Sep 22, 2016
096670c
Ignore various entire test modules on emscripten
brson Sep 22, 2016
834bbab
rustbuild: Only build 'dist' when building the host
brson Sep 23, 2016
d997a62
Call emcc with ERROR_ON_UNDEFINED_SYMBOLS
brson Sep 25, 2016
21b987e
Unignore some working emscripten tests
brson Sep 27, 2016
badfd62
Cleanup bootstrap
brson Sep 27, 2016
3c038c0
Document emscripten's unwind impl and remove unused function
brson Sep 27, 2016
4f5e73b
Build a dummy alloc_jemalloc crate on platforms that don't support it
brson Sep 27, 2016
afa72b5
Don't build any native compiler-builtin components for emscripten
brson Sep 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Call emcc with ERROR_ON_UNDEFINED_SYMBOLS
  • Loading branch information
brson committed Sep 30, 2016
commit d997a6291f42c9315f9ddd8d4044e8910ced8745
7 changes: 5 additions & 2 deletions src/libcoretest/num/flt2dec/estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// FIXME https://github.com/kripken/emscripten/issues/4563
// NB we have to actually not compile this test to avoid
// an undefined symbol error
#![cfg(not(target_os = "emscripten"))]

use core::num::flt2dec::estimator::*;

#[test]
// FIXME https://github.com/kripken/emscripten/issues/4563
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_estimate_scaling_factor() {
macro_rules! assert_almost_eq {
($actual:expr, $expected:expr) => ({
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/asmjs_unknown_emscripten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn target() -> Result<Target, String> {
allow_asm: false,
obj_is_bitcode: true,
max_atomic_width: 32,
post_link_args: vec!["-s".to_string(), "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string()],
.. Default::default()
};
Ok(Target {
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_back/target/wasm32_unknown_emscripten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ pub fn target() -> Result<Target, String> {
allow_asm: false,
obj_is_bitcode: true,
max_atomic_width: 32,
post_link_args: vec!["-s".to_string(), "BINARYEN=1".to_string()],
post_link_args: vec!["-s".to_string(), "BINARYEN=1".to_string(),
"-s".to_string(), "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string()],
.. Default::default()
};
Ok(Target {
Expand Down
5 changes: 2 additions & 3 deletions src/libstd/sys/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl Command {
}

// NaCl has no signal support.
if cfg!(not(target_os = "nacl")) {
if cfg!(not(any(target_os = "nacl", target_os = "emscripten"))) {
// Reset signal handling so the child process starts in a
// standardized state. libstd ignores SIGPIPE, and signal-handling
// libraries often set a mask. Child processes inherit ignored
Expand Down Expand Up @@ -589,7 +589,7 @@ impl Process {
}
}

#[cfg(test)]
#[cfg(all(test, not(target_os = "emscripten")))]
mod tests {
use super::*;

Expand Down Expand Up @@ -630,7 +630,6 @@ mod tests {
#[test]
#[cfg_attr(target_os = "macos", ignore)]
#[cfg_attr(target_os = "nacl", ignore)] // no signals on NaCl.
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_process_mask() {
unsafe {
// Test to make sure that a signal mask does not get inherited.
Expand Down
18 changes: 16 additions & 2 deletions src/libstd/sys/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ pub struct Thread {
unsafe impl Send for Thread {}
unsafe impl Sync for Thread {}

// The pthread_attr_setstacksize symbol doesn't exist in the emscripten libc,
// so we have to not link to it to satisfy emcc's ERROR_ON_UNDEFINED_SYMBOLS.
#[cfg(not(target_os = "emscripten"))]
unsafe fn pthread_attr_setstacksize(attr: *mut libc::pthread_attr_t,
stack_size: libc::size_t) -> libc::c_int {
libc::pthread_attr_setstacksize(attr, stack_size)
}

#[cfg(target_os = "emscripten")]
unsafe fn pthread_attr_setstacksize(_attr: *mut libc::pthread_attr_t,
_stack_size: libc::size_t) -> libc::c_int {
panic!()
}

impl Thread {
pub unsafe fn new<'a>(stack: usize, p: Box<FnBox() + 'a>)
-> io::Result<Thread> {
Expand All @@ -38,8 +52,8 @@ impl Thread {
assert_eq!(libc::pthread_attr_init(&mut attr), 0);

let stack_size = cmp::max(stack, min_stack_size(&attr));
match libc::pthread_attr_setstacksize(&mut attr,
stack_size as libc::size_t) {
match pthread_attr_setstacksize(&mut attr,
stack_size as libc::size_t) {
0 => {}
n => {
assert_eq!(n, libc::EINVAL);
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/format-no-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-emscripten missing rust_begin_unwind
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still an issue?

Copy link
Contributor Author

@brson brson Sep 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Don't know why.


#![feature(lang_items, start, collections)]
#![no_std]

Expand Down