-
Notifications
You must be signed in to change notification settings - Fork 849
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
Experimental Native Compilation Refactor #2272
Closed
Closed
Changes from 27 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
b2a41a7
WIP of LLVM metadata as a function generator
syrusakbary 438ded1
Merge branch 'middleware-refactor' into llvm-traps
syrusakbary cc74ba6
Merge branch 'master' into llvm-traps
syrusakbary fe05ed0
First working iteration of proper Native loading
syrusakbary 6d1ca9e
Refactored struct representation of experimental native compilation
syrusakbary 69f716d
Fixed linting issues
syrusakbary 5fa5379
Update lib/compiler/src/compiler.rs
syrusakbary 5ca3d84
Update lib/compiler-llvm/src/compiler.rs
syrusakbary 7f726ca
Update wasmparser
syrusakbary b97139a
Merge branch 'llvm-traps' of github.com:wasmerio/wasmer into llvm-traps
syrusakbary f1d649d
Improved create-exe
syrusakbary ca0da94
Merge branch 'master' into llvm-traps
syrusakbary 91e24f0
Merge branch 'universal-compiled-info' into llvm-traps
syrusakbary e845d45
Updated serialization mechanism
syrusakbary b37981b
Attach frame info registration in native and object-file engine
syrusakbary 727ec5a
Merge branch 'master' into llvm-traps
syrusakbary 26235a7
Update lib/engine-native/src/serialize.rs
syrusakbary 37e566d
Update lib/compiler-llvm/src/object_file.rs
syrusakbary bd84b4c
Update lib/engine-native/src/artifact.rs
syrusakbary 32f0e34
Update lib/compiler-llvm/src/object_file.rs
syrusakbary 19ef939
Update lib/compiler-llvm/src/object_file.rs
syrusakbary cc2cc77
Update lib/engine-object-file/src/artifact.rs
syrusakbary 6eb7084
Improvoed comment
syrusakbary 555b16f
Reuse variable
syrusakbary c352602
Fixed function body sizes
syrusakbary b183538
Update indexmap version
syrusakbary e73ebb1
Merge branch 'master' into llvm-traps
syrusakbary 8aa7247
Fixed duplicated imports
syrusakbary 17b3b8e
Update lib/engine-object-file/src/artifact.rs
syrusakbary fe3210a
Update lib/engine-native/src/artifact.rs
syrusakbary 355134e
Update lib/engine-native/src/artifact.rs
syrusakbary 1deb551
Merge branch 'master' into llvm-traps
syrusakbary f86597e
Added check for wasm pc (so we only trap on Wasm functions)
syrusakbary 6d02377
Addressed all comments
syrusakbary d3a8d0b
Make objectfile the same for windows and unix
syrusakbary d3c856b
Improve readability of frameinfo
syrusakbary b900b5b
Merge branch 'master' into llvm-traps
syrusakbary 374da7b
Fixed compilation issue with data
syrusakbary cd17339
Remove endianess check in engines
syrusakbary 360af93
Merge branch 'llvm-traps' of https://github.com/wasmerio/wasmer into …
syrusakbary 067391c
Fixed linting
syrusakbary 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -71,9 +71,9 @@ impl CreateExe { | |
env::set_current_dir(&working_dir)?; | ||
|
||
#[cfg(not(windows))] | ||
let wasm_object_path = PathBuf::from("wasm.o"); | ||
let wasm_object_path = PathBuf::from("wasm.a"); | ||
#[cfg(windows)] | ||
let wasm_object_path = PathBuf::from("wasm.obj"); | ||
let wasm_object_path = PathBuf::from("wasm.a"); | ||
|
||
let wasm_module_path = starting_cd.join(&self.path); | ||
|
||
|
@@ -284,23 +284,42 @@ impl LinkCode { | |
} else { | ||
command | ||
}; | ||
|
||
// Add libraries required per platform. | ||
// We need userenv, sockets (Ws2_32), advapi32 for some system calls and bcrypt for random numbers. | ||
#[cfg(windows)] | ||
let command = command | ||
.arg("-Wl,--whole-archive") | ||
.arg("-luserenv") | ||
.arg("-lWs2_32") | ||
.arg("-ladvapi32") | ||
.arg("-lbcrypt"); | ||
// On unix we need dlopen-related symbols, libmath for a few things, and pthreads. | ||
|
||
cfg_if::cfg_if! { | ||
if #[cfg(target_os = "macos")] { | ||
let command = command.arg("-Wl,-all_load"); | ||
} | ||
else if #[cfg(unix)] { | ||
let command = command.arg("-Wl,--whole-archive"); | ||
} | ||
else if #[cfg(windows)] { | ||
let command = command.arg("-Wl,--whole-archive"); | ||
} | ||
} | ||
|
||
#[cfg(not(windows))] | ||
let command = command.arg("-ldl").arg("-lm").arg("-pthread"); | ||
let link_aganist_extra_libs = self | ||
.additional_libraries | ||
.iter() | ||
.map(|lib| format!("-l{}", lib)); | ||
let command = command.args(link_aganist_extra_libs); | ||
let output = command.arg("-o").arg(&self.output_path).output()?; | ||
let command = command | ||
.args(link_aganist_extra_libs) | ||
.arg("-o") | ||
.arg(&self.output_path); | ||
println!("COMMAND: {:?}", command); | ||
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. TODO: Remove |
||
let output = command.output()?; | ||
|
||
if !output.status.success() { | ||
bail!( | ||
|
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.
No longer need windows/non-windows here since they're the same.