-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from swiftwasm/omit-unsafe-linker-flags
Remove all unsafe linker flags from Package.swift
- Loading branch information
Showing
10 changed files
with
83 additions
and
100 deletions.
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 |
---|---|---|
@@ -1 +1 @@ | ||
wasm-5.3-SNAPSHOT-2020-08-10-a | ||
wasm-5.3-SNAPSHOT-2020-10-02-a |
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 was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "_CJavaScriptKit.h" | ||
#include <stdlib.h> | ||
|
||
#if __wasm32__ | ||
|
||
void _call_host_function_impl(const JavaScriptHostFuncRef host_func_ref, | ||
const RawJSValue *argv, const int argc, | ||
const JavaScriptObjectRef callback_func); | ||
|
||
__attribute__((export_name("swjs_call_host_function"))) | ||
void _call_host_function(const JavaScriptHostFuncRef host_func_ref, | ||
const RawJSValue *argv, const int argc, | ||
const JavaScriptObjectRef callback_func) { | ||
_call_host_function_impl(host_func_ref, argv, argc, callback_func); | ||
} | ||
|
||
__attribute__((export_name("swjs_prepare_host_function_call"))) | ||
void *_prepare_host_function_call(const int argc) { | ||
return malloc(argc * sizeof(RawJSValue)); | ||
} | ||
|
||
__attribute__((export_name("swjs_cleanup_host_function_call"))) | ||
void _cleanup_host_function_call(void *argv_buffer) { | ||
free(argv_buffer); | ||
} | ||
|
||
/// The compatibility runtime library version. | ||
/// Notes: If you change any interface of runtime library, please increment | ||
/// this and `SwiftRuntime.version` in `./Runtime/src/index.ts`. | ||
__attribute__((export_name("swjs_library_version"))) | ||
int _library_version() { | ||
return 700; | ||
} | ||
|
||
#endif |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
scripts_dir="$(cd "$(dirname $0)" && pwd)" | ||
|
||
swift_version="$(cat $scripts_dir/../.swift-version)" | ||
swift_tag="swift-$swift_version" | ||
|
||
if [ -z "$(which swiftenv)" ]; then | ||
echo "swiftenv not installed, please install it before this script." | ||
exit 1 | ||
fi | ||
|
||
if [ ! -z "$(swiftenv versions | grep $swift_version)" ]; then | ||
echo "$swift_version is already installed." | ||
exit 0 | ||
fi | ||
|
||
case $(uname -s) in | ||
Darwin) | ||
toolchain_download="$swift_tag-osx.tar.gz" | ||
;; | ||
Linux) | ||
if [ $(grep RELEASE /etc/lsb-release) == "DISTRIB_RELEASE=18.04" ]; then | ||
toolchain_download="$swift_tag-ubuntu18.04.tar.gz" | ||
elif [ $(grep RELEASE /etc/lsb-release) == "DISTRIB_RELEASE=20.04" ]; then | ||
toolchain_download="$swift_tag-ubuntu20.04.tar.gz" | ||
else | ||
echo "Unknown Ubuntu version" | ||
exit 1 | ||
fi | ||
;; | ||
*) | ||
echo "Unrecognised platform $(uname -s)" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
toolchain_download_url="https://github.com/swiftwasm/swift/releases/download/$swift_tag/$toolchain_download" | ||
|
||
swiftenv install "$toolchain_download_url" |