Update emscripten to v3.1.14 (#2775)

This commit is contained in:
Hood Chatham 2022-06-23 15:51:06 -07:00 committed by GitHub
parent 9aa179a520
commit f3e8836902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 116 deletions

View File

@ -1,7 +1,7 @@
export PYVERSION ?= 3.10.2
# Note: when updating EMSCRIPTEN_VERSION make sure to update
# the version number in the "uname" patch.
export PYODIDE_EMSCRIPTEN_VERSION ?= 3.1.13
export PYODIDE_EMSCRIPTEN_VERSION ?= 3.1.14
export PLATFORM_TRIPLET=wasm32-emscripten
export SYSCONFIG_NAME=_sysconfigdata__emscripten_$(PLATFORM_TRIPLET)

View File

@ -1,47 +1,37 @@
From b8c1b850cf029cbfd23a41f2695fe7e924d07348 Mon Sep 17 00:00:00 2001
From a09d9d9cfeb105e1ce2e398c1c6e706319c8adf6 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sun, 29 May 2022 18:17:29 -0700
Subject: [PATCH 1/2] Add BigInt64Array shim for Safari 14
Subject: [PATCH] Add BigInt64Array shim for Safari 14
https://github.com/emscripten-core/emscripten/pull/17103
---
ChangeLog.md | 21 +++++++++
ChangeLog.md | 4 ++
src/polyfill/bigint64array.js | 88 +++++++++++++++++++++++++++++++++++
src/shell.js | 5 ++
3 files changed, 114 insertions(+)
3 files changed, 97 insertions(+)
create mode 100644 src/polyfill/bigint64array.js
diff --git a/ChangeLog.md b/ChangeLog.md
index fecdfa383..cb65c0d29 100644
index d1f8cf1ea..37094a45a 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -20,6 +20,27 @@ See docs/process.md for more on how version tagging works.
3.1.13
------
@@ -25,6 +25,8 @@ See docs/process.md for more on how version tagging works.
- `tools/file_packager` no longer generates (or requires) any "pre-js" code when
running in `--embed-file` mode. Instead the embedded files are loaded at
static constructor time.
+3.2.0
+-----
+- Emscripten now knows what minimum browser versions the `WASM_BIGINT` feature
+ requires and will automatically set the defaults accordingly. (#17163)
+- Weak undefined symbols fixed in dynamic linking. (#17164)
+- Internally, the name of `main` function now gets mangled (by clang) in the
+ same way as with other wasm targets. This means that within the wasm module
+ the name of the main function can now be `__main_argc_argv`, but, since we
+ still export this to JS as `_main`, this should not be a user-visible change.
+- Use of pkg-config from cmake not longer causes the C++ include path to be
+ broken. (#17137)
+- `emscripten_runtime_keeplive_push()` and `emscripten_runtime_keeplive_push()`
+ are now exposed to native code and can be used to keep the runtime alive
+ without immediately unwinding the event loop (as
+ `emscripten_exit_with_live_runtime()` does). (#17160)
- Emscripten now knows what minimum browser versions the `WASM_BIGINT` feature
requires and will automatically set the defaults accordingly. (#17163)
- Weak undefined symbols fixed in dynamic linking. (#17164)
@@ -40,6 +42,8 @@ See docs/process.md for more on how version tagging works.
`emscripten_exit_with_live_runtime()` does). (#17160)
- The file packager option `--use-preload-cache` now only invalidates the
cache if the data contents has changed. (#16807)
+- Added a shim for `BigInt64Array` so `-sWASM_BIGINT` can be used in Safari
+ v14. (#17103)
+
+3.1.13 - 06/02/2022
+-------------------
+- xlocale.h compatibility header was restored after being removed in 3.1.12.
3.1.12 - 05/25/2022
3.1.13 - 06/02/2022
-------------------
diff --git a/src/polyfill/bigint64array.js b/src/polyfill/bigint64array.js
new file mode 100644

View File

@ -1,88 +0,0 @@
From e6d94de69535b7dfa1941655217e1410199ef059 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Wed, 8 Jun 2022 22:06:54 -0700
Subject: [PATCH 2/2] Fix dup again
https://github.com/emscripten-core/emscripten/pull/17184
---
src/library_fs.js | 16 +++++++++++++---
tests/unistd/dup.c | 10 ++++++++++
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/src/library_fs.js b/src/library_fs.js
index 88f3bd98c..1e768763b 100644
--- a/src/library_fs.js
+++ b/src/library_fs.js
@@ -403,29 +403,39 @@ FS.staticInit();` +
FS.FSStream = /** @constructor */ function() {
this.shared = { };
};
- FS.FSStream.prototype = {
+ FS.FSStream.prototype = {};
+ Object.defineProperties(FS.FSStream.prototype, {
object: {
+ /** @this {FS.FSStream} */
get: function() { return this.node; },
+ /** @this {FS.FSStream} */
set: function(val) { this.node = val; }
},
isRead: {
+ /** @this {FS.FSStream} */
get: function() { return (this.flags & {{{ cDefine('O_ACCMODE') }}}) !== {{{ cDefine('O_WRONLY') }}}; }
},
isWrite: {
+ /** @this {FS.FSStream} */
get: function() { return (this.flags & {{{ cDefine('O_ACCMODE') }}}) !== {{{ cDefine('O_RDONLY') }}}; }
},
isAppend: {
+ /** @this {FS.FSStream} */
get: function() { return (this.flags & {{{ cDefine('O_APPEND') }}}); }
},
flags: {
+ /** @this {FS.FSStream} */
get: function() { return this.shared.flags; },
+ /** @this {FS.FSStream} */
set: function(val) { this.shared.flags = val; },
},
position : {
- get function() { return this.shared.position; },
+ /** @this {FS.FSStream} */
+ get: function() { return this.shared.position; },
+ /** @this {FS.FSStream} */
set: function(val) { this.shared.position = val; },
},
- };
+ });
}
// clone it, so we can return an instance of FSStream
stream = Object.assign(new FS.FSStream(), stream);
diff --git a/tests/unistd/dup.c b/tests/unistd/dup.c
index c238678d3..814df5a25 100644
--- a/tests/unistd/dup.c
+++ b/tests/unistd/dup.c
@@ -10,6 +10,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <emscripten.h>
+#include <assert.h>
int main() {
@@ -59,5 +60,14 @@ int main() {
read(g, buf, 5);
// should print "buf: abc\n"
printf("buf: %s\n", buf);
+
+
+ int fd1 = open("./blah.txt", O_RDWR | O_CREAT | O_EXCL, 0600);
+ int fd2 = dup(fd1);
+ int n = write(fd1, "abcabc\n", 7);
+ assert(n == 7);
+ assert(lseek(fd1, 0, SEEK_CUR) == 7);
+ assert(lseek(fd2, 0, SEEK_CUR) == 7);
+
return 0;
}
--
2.25.1