-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Initial emscripten work #30453
Closed
Closed
Initial emscripten work #30453
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# asmjs-unknown-emscripten configuration | ||
CC_asmjs-unknown-emscripten=emcc | ||
CXX_asmjs-unknown-emscripten=em++ | ||
CPP_asmjs-unknown-emscripten=$(CPP) | ||
AR_asmjs-unknown-emscripten=emar | ||
CFG_LIB_NAME_asmjs-unknown-emscripten=lib$(1).so | ||
CFG_STATIC_LIB_NAME_asmjs-unknown-emscripten=lib$(1).a | ||
CFG_LIB_GLOB_asmjs-unknown-emscripten=lib$(1)-*.so | ||
CFG_LIB_DSYM_GLOB_asmjs-unknown-emscripten=lib$(1)-*.dylib.dSYM | ||
CFG_JEMALLOC_CFLAGS_asmjs-unknown-emscripten := -m32 $(CFLAGS) | ||
# NB: The EMSCRIPTEN environment variable is set by the emscripten SDK. | ||
# This is only needed here to so the compiler-rt build can find unwind.h, | ||
# but the asmjs target *doesn't even link to compiler-rt*. | ||
CFG_GCCISH_CFLAGS_asmjs-unknown-emscripten := -Wall -Werror -g -fPIC -m32 $(CFLAGS) \ | ||
-I$(EMSCRIPTEN)/system/lib/libcxxabi/include | ||
CFG_GCCISH_CXXFLAGS_asmjs-unknown-emscripten := -fno-rtti $(CXXFLAGS) | ||
CFG_GCCISH_LINK_FLAGS_asmjs-unknown-emscripten := -shared -fPIC -ldl -pthread -lrt -g -m32 | ||
CFG_GCCISH_DEF_FLAG_asmjs-unknown-emscripten := -Wl,--export-dynamic,--dynamic-list= | ||
CFG_LLC_FLAGS_asmjs-unknown-emscripten := | ||
CFG_INSTALL_NAME_asmjs-unknown-emscripten = | ||
CFG_EXE_SUFFIX_asmjs-unknown-emscripten = | ||
CFG_WINDOWSY_asmjs-unknown-emscripten := | ||
CFG_UNIXY_asmjs-unknown-emscripten := 1 | ||
CFG_LDPATH_asmjs-unknown-emscripten := | ||
CFG_RUN_asmjs-unknown-emscripten=$(2) | ||
CFG_RUN_TARG_asmjs-unknown-emscripten=$(call CFG_RUN_asmjs-unknown-emscripten,,$(2)) | ||
CFG_GNU_TRIPLE_asmjs-unknown-emscripten := asmjs-unknown-emscripten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule liblibc
updated
3 files
+6 −1 | src/unix/mod.rs | |
+2 −1 | src/unix/notbsd/linux/mod.rs | |
+3 −2 | src/unix/notbsd/mod.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use super::{Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let opts = TargetOptions { | ||
linker: "emcc".to_string(), | ||
ar: "emar".to_string(), | ||
|
||
dynamic_linking: false, | ||
executables: true, | ||
exe_suffix: ".js".to_string(), | ||
no_compiler_rt: true, | ||
linker_is_gnu: true, | ||
allow_asm: false, | ||
archive_format: "gnu".to_string(), | ||
obj_is_bitcode: true, | ||
.. Default::default() | ||
}; | ||
Target { | ||
llvm_target: "asmjs-unknown-emscripten".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_os: "emscripten".to_string(), | ||
target_env: "".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
arch: "asmjs".to_string(), | ||
options: opts, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use trans::cabi::FnType; | ||
use trans::cabi_arm; | ||
use trans::context::CrateContext; | ||
use trans::type_::Type; | ||
|
||
pub fn compute_abi_info(ccx: &CrateContext, | ||
atys: &[Type], | ||
rty: Type, | ||
ret_def: bool) -> FnType { | ||
cabi_arm::compute_abi_info(ccx, atys, rty, ret_def, | ||
cabi_arm::Flavor::General) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,8 @@ mod tests { | |
target_os = "dragonfly", | ||
target_os = "bitrig", | ||
target_os = "netbsd", | ||
target_os = "openbsd"))] | ||
target_os = "openbsd", | ||
target_os = "emscripten"))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't wait to remove this file... |
||
mod dl { | ||
use prelude::v1::*; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a custom target option to disable compiler-rt, so perhaps we could avoid building compiler-rt and avoid linking it entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait it looks like
no_compiler_rt
is already set, I wonder if we could avoid building compiler-rt like libbacktrace is avoided?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into it. I punted on it last time I looked at rt.mk just because that file was so difficult.