Skip to content

Commit e9bb8de

Browse files
committed
Merge branch 'main'
2 parents 3b124a6 + de7cbc5 commit e9bb8de

File tree

554 files changed

+23771
-8667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

554 files changed

+23771
-8667
lines changed

.circleci/config.yml

Lines changed: 153 additions & 91 deletions
Large diffs are not rendered by default.

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ignorePatterns:
2222
- "src/emrun_postjs.js"
2323
- "src/worker.js"
2424
- "src/wasm_worker.js"
25+
- "src/audio_worklet.js"
2526
- "src/wasm2js.js"
2627
- "src/webGLClient.js"
2728
- "src/webGLWorker.js"
@@ -30,7 +31,6 @@ ignorePatterns:
3031
- "src/threadprofiler.js"
3132
- "src/cpuprofiler.js"
3233
- "src/memoryprofiler.js"
33-
- "src/support.js"
3434
- "src/gl-matrix.js"
3535
- "src/headless.js"
3636
- "src/headlessCanvas.js"

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "test/third_party/posixtestsuite"]
22
path = test/third_party/posixtestsuite
33
url = https://github.com/emscripten-core/posixtestsuite
4+
[submodule "test/third_party/googletest"]
5+
path = test/third_party/googletest
6+
url = https://github.com/google/googletest

ChangeLog.md

Lines changed: 110 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,109 @@ to browse the changes between the tags.
1818

1919
See docs/process.md for more on how version tagging works.
2020

21-
3.1.29 (in development)
21+
3.1.35 (in development)
2222
-----------------------
23+
- `SDL_image` port was updated to version 2.6.0.
24+
- `-z` arguments are now passed directly to wasm-ld without the need for the
25+
`-Wl,` prefix. This matches the behaviour of both clang and gcc. (#18956)
26+
- Reverted #18525 which runs the JS pre-processor over files passed via
27+
--pre-js and --post-js. It turned out this change caused issue for several
28+
folks who had JS files with lines that start with `#` so can't be run through
29+
the pre-processor. If folks want to re-enable this we can looks into ways to
30+
make it conditional/optional.
31+
- The `{{{ cDefine('name') }}}` helper macro can now be simplified to just `{{{
32+
cDefs.name }}}`.
33+
34+
3.1.34 - 03/14/23
35+
-----------------
36+
- Fix for using `EM_JS` functions defined in other object files. This was a bug
37+
that was introduced when `LLD_REPORT_UNDEFINED` was enabled by default back in
38+
3.1.28. (#18928)
39+
- The prefered way to enable pthread is now to just the the standard `-pthread`
40+
flag. The `-sUSE_PTHREADS` setting still works but is marked as legacy and
41+
will generate a warning in `-sSTRICT` mode.
42+
- When targeting node, and using `-sMODULARIZE`, we no longer internally catch
43+
unhandled promise rejections or exit status code. That is to say the,
44+
`NODEJS_CATCH_REJECTION` and `NODEJS_CATCH_EXIT` are no longer compatible
45+
with `-sMODULARIZE`.
46+
47+
3.1.33 - 03/08/23
48+
-----------------
49+
- Initial support for C++20 modules. We have added a very simple test in form
50+
of `other.test_cpp_module`. (#18915)
51+
- Removed `sys/sysctl.h` compatibility header. We don't implement the function
52+
it defines. (#18863)
53+
- Update SDL2_ttf port to 2.20.2 (#18804)
54+
- Update glfw header to 3.3.8 (#18826)
55+
- The `LLD_REPORT_UNDEFINED` setting has been removed. It's now essentially
56+
always enabled. (#18342)
57+
- Added `-sEXPORT_KEEPALIVE` to export symbols. When using
58+
`MINIMAL_RUNTIME`, the option will be **disabled** by default.
59+
This option simply exports the symbols on the module object, i.e.,
60+
`Module['X'] = X;`
61+
- The WasmFS OPFS backend is now faster in browsers that implement
62+
[`Atomics.waitAsync`](https://caniuse.com/mdn-javascript_builtins_atomics_waitasync).
63+
(#18861)
64+
65+
3.1.32 - 02/17/23
66+
-----------------
67+
- Added new linker option `-sEXCEPTION_STACK_TRACES` which will display a stack
68+
trace when an uncaught exception occurs. This defaults to true when
69+
`ASSERTIONS` is enabled. This option is mainly for the users who want only
70+
exceptions' stack traces without turning `ASSERTIONS` on. (#18642 and #18535)
71+
- `SUPPORT_LONGJMP`'s default value now depends on the exception mode. If Wasm
72+
EH (`-fwasm-exception`) is used, it defaults to `wasm`, and if Emscripten EH
73+
(`-sDISABLE_EXCEPTION_CATCHING=0`) is used or no exception support is used, it
74+
defaults to `emscripten`. Previously it always defaulted to `emscripten`, so
75+
when a user specified `-fwasm-exceptions`, it resulted in Wasm EH + Emscripten
76+
SjLj, the combination we do not intend to support for the long term.
77+
- Added support for Wasm-based AudioWorklets for realtime audio processing
78+
(#16449)
79+
- Synchronous proxying functions in emscripten/proxying.h now return errors
80+
instead of hanging forever when the worker thread dies before the proxied work
81+
is finished.
82+
- The `emscripten_proxy_async_with_callback` API was replaced with a simpler
83+
`emscripten_proxy_callback` API that takes a second callback to be called if
84+
the worker thread dies before completing the proxied work.
85+
86+
3.1.31 - 01/26/23
87+
-----------------
88+
- Symbols that were previously exported from native code, but only for internal
89+
reasons, are no longer exported on the `Module` object by default. For
90+
example, previously if you were using `Module._malloc` but not explicitly
91+
including `_malloc` in `EXPORTED_FUNCTIONS`, it might have been exported
92+
anyway due to internal use of `malloc` within the JS library code. (#18564)
93+
- The `STACK_SIZE`, `STACK_ALIGN`, `POINTER_SIZE`, and `ASSERTIONS` JavaScript
94+
globals were removed by default. In debug builds a clear error is shown if
95+
you try to use these. (#18503)
96+
- --pre-js and --post-js files are now fed through the JS preprocessor, just
97+
like JS library files and the core runtime JS files. This means they can
98+
now contain #if/#else/#endif blocks and {{{ }}} macro blocks. (#18525)
99+
- `-sEXPORT_ALL` can now be used to export symbols on the `Module` object
100+
when used with `-sMINIMAL_RUNTIME` and `-sMODULARIZE` together. (#17911)
101+
- The llvm version that emscripten uses was updated to 17.0.0 trunk.
102+
103+
3.1.30 - 01/11/23
104+
-----------------
105+
- The default pthread stack size will now be set to match `-sSTACK_SIZE` by
106+
default. Set `DEFAULT_PTHREAD_STACK_SIZE` explicitly to override this.
107+
(#18479)
108+
- The `buffer` JavaScript variable was removed. This underlying buffer is
109+
still accessible via `wasmMemory.buffer` or `HEAPXX.buffer`. In debug builds,
110+
a clear error is shown if you try to use it. (#18454)
111+
- The SDLv1 header directory is no longer added to the include path by default.
112+
This means if you include SDL headers without the explicit version in them
113+
(e.g. `SDL_events.h`) you will now need to add `-sUSE_SDL` explicitly at
114+
compile time. If you include the SDL headers with the directory name included
115+
(e.g. `SDL/SDL_events.h`) you will not be affected by this change. (#18443)
116+
- Significant improvements were made (in the version of LLVM associated with
117+
this emsdk release) to the quality of DWARF debug info when building in
118+
optimized mode. See https://reviews.llvm.org/D140373. Using the -O1 flag is
119+
recommended if a program is too large or slow to debug with -O0 (although
120+
-O0 is still better for debugging when feasible).
121+
122+
3.1.29 - 01/03/23
123+
-----------------
23124
- Fixed bug in `PROXY_TO_PTHREAD` whereby certain async operations on the main
24125
thread would cause the whole program to exit, even when the proxied main
25126
function was still running. (#18372)
@@ -258,7 +359,7 @@ See docs/process.md for more on how version tagging works.
258359
However, they all still available by default due to a new setting called
259360
`LEGACY_RUNTIME` which is enabled by default. When `LEGACY_RUNTIME` is
260361
disabled (which it may be in the future) these symbols would only be included
261-
if there were explictly exported via `EXPORTED_RUNTIME_METHODS` or added to
362+
if there were explicitly exported via `EXPORTED_RUNTIME_METHODS` or added to
262363
`DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`. `LEGACY_RUNTIME` is disabled by default
263364
in `STRICT` mode so this change only effects users of `STRICT` mode. (#17370,
264365
#17403)
@@ -354,7 +455,7 @@ See docs/process.md for more on how version tagging works.
354455
binaryen optimizations are limited due to DWARF information being requested.
355456
Several binaryen passed are not compatible with the preservation of DWARF
356457
information. (#16428)
357-
- Use normalized mouse wheel delta for GLFW 3 in `library_glfw.js`. This changes
458+
- Use normalized mouse wheel delta for GLFW 3 in `library_glfw.js`. This changes
358459
the vertical scroll amount for GLFW 3. (#16480)
359460
- The emsdk binaries for macOS now require macOS 10.14 Mojave (or above).
360461
Prior versions of emsdk could run on 10.11 (or above), but supporting those
@@ -392,7 +493,7 @@ See docs/process.md for more on how version tagging works.
392493
3.1.5 - 02/17/2022
393494
------------------
394495
- Emscripten no longer uses the `allocate()` runtime function. For backwards
395-
compatabiliy with external JS code we still include this function by default
496+
compatibility with external JS code we still include this function by default
396497
but it will no longer be included in `-sSTRICT` mode. Usages of this function
397498
are generally best replaced with `_malloc`, `stackAlloc` or `allocateUTF8`.
398499

@@ -462,7 +563,7 @@ See docs/process.md for more on how version tagging works.
462563
For most users targeting the default set of browsers this is a code size win.
463564
For projects targeting older browsers (e.g. `-sMIN_CHROME_VERSION=10`),
464565
emscripten will now run closure compiler in `WHITESPACE_ONLY` mode in order to
465-
traspile any ES6 down to ES5. When this automatic transpilation is performed
566+
transpile any ES6 down to ES5. When this automatic transpilation is performed
466567
we generate a warning which can be disabled (using `-Wno-transpile`) or by
467568
explicitly opting in-to or out-of closure using `--closure=1` or
468569
`--closure=0`. (#15763).
@@ -539,7 +640,7 @@ See docs/process.md for more on how version tagging works.
539640
EM_WORKAROUND_PYTHON_BUG_34780 and EM_WORKAROUND_WIN7_BAD_ERRORLEVEL_BUG that
540641
can be enabled to work around a Windows Python issue
541642
https://bugs.python.org/issue34780 , and a Windows 7 exit code issue (#15146)
542-
- Support a new CMake propert `EMSCRIPTEN_SYSTEM_PROCESSOR` which can be used
643+
- Support a new CMake property `EMSCRIPTEN_SYSTEM_PROCESSOR` which can be used
543644
to override the default value of `CMAKE_SYSTEM_PROCESSOR` set by the
544645
toolchain file.
545646
- Remove support for the `EMIT_EMSCRIPTEN_METADATA` setting. This setting has
@@ -700,7 +801,7 @@ See docs/process.md for more on how version tagging works.
700801
list of symbols can now use a simple one-symbol-per-line format. This new
701802
format is much simpler and doesn't require commas between symbols, opening
702803
or closing braces, or any kind of escaping for special characters.
703-
- The WebAssembly linker (`wasm-ld`) now performes string tail merging on any
804+
- The WebAssembly linker (`wasm-ld`) now performs string tail merging on any
704805
static string data in your program. This has long been part of the native
705806
ELF linker and should not be observable in well-behaved programs. This
706807
behavior can be disabled by passing `-Wl,-O0`.
@@ -765,9 +866,9 @@ See docs/process.md for more on how version tagging works.
765866
list explicit `EXPORTED_FUNCTIONS`. Also, users of `MAIN_MODULE=1` with
766867
dynamic linking (not dlopen) who list all side modules on the command line,
767868
should be able to switch to `MAIN_MODULE=2` and get a reduction in code size.
768-
- When building with `MAIN_MODULE` it is now possbile to warn or error on
869+
- When building with `MAIN_MODULE` it is now possible to warn or error on
769870
undefined symbols assuming all the side modules are passed at link time. This
770-
means that for many projects it should now be possbile to enable
871+
means that for many projects it should now be possible to enable
771872
`ERROR_ON_UNDEFINED_SYMBOLS` along with `MAIN_MODULE`.
772873

773874
2.0.17: 04/10/2021

cmake/Modules/FindOpenAL.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# The implementation is based on the standard FindOpenAL.cmake provided with CMake,
88
# but customized for targeting Emscripten only.
99

10-
if (NOT OPENAL_FOUND)
10+
if (NOT OpenAL_FOUND OR NOT OPENAL_FOUND)
11+
SET(OpenAL_FOUND TRUE)
1112
SET(OPENAL_FOUND TRUE)
1213

1314
# For Emscripten-compiled apps in the test suite (test_alut), this is expected...

cmake/Modules/Platform/Emscripten.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@ else()
8787
endif()
8888

8989
# Specify the compilers to use for C and C++
90-
set(CMAKE_C_COMPILER "${EMSCRIPTEN_ROOT_PATH}/emcc${EMCC_SUFFIX}" CACHE FILEPATH "Emscripten emcc")
91-
set(CMAKE_CXX_COMPILER "${EMSCRIPTEN_ROOT_PATH}/em++${EMCC_SUFFIX}" CACHE FILEPATH "Emscripten em++")
92-
set(CMAKE_AR "${EMSCRIPTEN_ROOT_PATH}/emar${EMCC_SUFFIX}" CACHE FILEPATH "Emscripten ar")
93-
set(CMAKE_RANLIB "${EMSCRIPTEN_ROOT_PATH}/emranlib${EMCC_SUFFIX}" CACHE FILEPATH "Emscripten ranlib")
94-
set(CMAKE_C_COMPILER_AR "${CMAKE_AR}" CACHE FILEPATH "Emscripten ar")
95-
set(CMAKE_CXX_COMPILER_AR "${CMAKE_AR}" CACHE FILEPATH "Emscripten ar")
96-
set(CMAKE_C_COMPILER_RANLIB "${CMAKE_RANLIB}" CACHE FILEPATH "Emscripten ranlib")
97-
set(CMAKE_CXX_COMPILER_RANLIB "${CMAKE_RANLIB}" CACHE FILEPATH "Emscripten ranlib")
90+
set(CMAKE_C_COMPILER "${EMSCRIPTEN_ROOT_PATH}/emcc${EMCC_SUFFIX}")
91+
set(CMAKE_CXX_COMPILER "${EMSCRIPTEN_ROOT_PATH}/em++${EMCC_SUFFIX}")
92+
set(CMAKE_NM "${EMSCRIPTEN_ROOT_PATH}/emnm${EMCC_SUFFIX}")
93+
set(CMAKE_AR "${EMSCRIPTEN_ROOT_PATH}/emar${EMCC_SUFFIX}")
94+
set(CMAKE_RANLIB "${EMSCRIPTEN_ROOT_PATH}/emranlib${EMCC_SUFFIX}")
95+
set(CMAKE_C_COMPILER_AR "${CMAKE_AR}")
96+
set(CMAKE_CXX_COMPILER_AR "${CMAKE_AR}")
97+
set(CMAKE_C_COMPILER_RANLIB "${CMAKE_RANLIB}")
98+
set(CMAKE_CXX_COMPILER_RANLIB "${CMAKE_RANLIB}")
9899

99100
# Capture the Emscripten version to EMSCRIPTEN_VERSION variable.
100101
if (NOT EMSCRIPTEN_VERSION)

docs/emcc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ Options that are modified or new in *emcc* are listed below:
547547
"--threadprofiler"
548548
[link] Embeds a thread activity profiler onto the generated page.
549549
Use this to profile the application usage of pthreads when
550-
targeting multithreaded builds (-sUSE_PTHREADS=1/2).
550+
targeting multithreaded builds (-pthread).
551551

552552
"--em-config <path>"
553553
[general] Specifies the location of the **.emscripten**

docs/process.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ How:
8888
[emscripten-releases][releases_repo] repo. When this CL is committed, let the
8989
resulting SHA be `<LTO-sha>`. An example of this CL is
9090
https://chromium-review.googlesource.com/c/emscripten-releases/+/3781978.
91-
1. Run [`./scripts/create_release.py`][create_release] in the emsdk repository.
92-
When we do both an LTO and a non-LTO release, run:
91+
1. Run [`scripts/create_release.py`][create_release_emsdk] in the emsdk
92+
repository. When we do both an LTO and a non-LTO release, run:
9393
```
9494
./scripts/create_release.py <LTO-sha> <non-LTO-sha>
9595
```
@@ -101,19 +101,21 @@ How:
101101
```
102102
This will make the `<non-LTO-sha>` point directly to the versioned name
103103
release (e.g. `3.1.7`) and there will be no assert build release. If we run
104-
[`./scripts/create_release.py`][create_release] without any arguments, it
104+
[`scripts/create_release.py`][create_release_emsdk] without any arguments, it
105105
will automatically pick a tot version from
106106
[emscripten-releases][releases_repo] repo and make it point to the versioned
107-
name release. Running this [`./scripts/create_release.py`][create_release]
108-
script will update [emscripten-releases-tags.json][emscripten_releases_tags],
109-
adding a new version. The script will create a new git branch that can be
110-
uploaded as a PR. An example of this PR is emscripten-core/emsdk#1071.
107+
name release. Running this
108+
[`scripts/create_release.py`][create_release_emsdk] script will update
109+
[emscripten-releases-tags.json][emscripten_releases_tags], adding a new
110+
version. The script will create a new git branch that can be uploaded as a
111+
PR. An example of this PR is emscripten-core/emsdk#1071.
111112
1. [Tag][emsdk_tags] the `emsdk` repo with the new version number, on the commit
112113
that does the update, after it lands on main.
113114
1. [Tag][emscripten_tags] the `emscripten` repo with the new version number, on
114115
the commit referred to in the [DEPS][DEPS] (or DEPS.tagged-release) file
115116
above.
116-
1. Run the `tools/maint/create_release.py` tool in the emscripten repo to update
117+
1. Run the [`tools/maint/create_release.py`][create_release_emscripten]
118+
tool in the emscripten repo to update
117119
[`emscripten-version.txt`][emscripten_version] and
118120
[`ChangeLog.md`][changelog]. An example of such PR is
119121
emscripten-core/emscripten#17439.
@@ -147,9 +149,9 @@ How:
147149
The site is currently hosted in `gh-pages` branch of the separate [site
148150
repository][site_repo]. To update the docs, rebuild them and copy them into
149151
this repository. There is a script that will perform these steps automatically:
150-
`tools/maint/update_docs.py`. Just run this script with no arguments if the
151-
emscripten-site repository is checked out alongside emscripten itself, or pass
152-
the location of the checkout if not.
152+
[`tools/maint/update_docs.py`][update_docs]. Just run this script with no
153+
arguments if the emscripten-site repository is checked out alongside emscripten
154+
itself, or pass the location of the checkout if not.
153155

154156
You will need the specific sphinx version installed, which you can do using
155157
`pip3 install -r requirements-dev.txt` (depending on your system, you may then
@@ -177,7 +179,8 @@ See notes above on installing sphinx.
177179
[waterfall]: https://ci.chromium.org/p/emscripten-releases/g/main/console
178180
[emscripten_version]: https://github.com/emscripten-core/emscripten/blob/main/emscripten-version.txt
179181
[changelog]: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md
180-
[create_release]: https://github.com/emscripten-core/emsdk/blob/main/scripts/create_release.py
182+
[create_release_emsdk]: https://github.com/emscripten-core/emsdk/blob/main/scripts/create_release.py
183+
[create_release_emscripten]: https://github.com/emscripten-core/emscripten/blob/main/tools/maint/create_release.py
181184
[emscripten_releases_tags]: https://github.com/emscripten-core/emsdk/blob/main/emscripten-releases-tags.json
182185
[DEPS]: https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/DEPS
183186
[DEPS.tagged-release]: https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/DEPS.tagged-release
@@ -186,3 +189,4 @@ See notes above on installing sphinx.
186189
[clang-format]: https://github.com/emscripten-core/emscripten/blob/main/.clang-format
187190
[flake8]: https://github.com/emscripten-core/emscripten/blob/main/.flake8
188191
[mypy]: https://github.com/emscripten-core/emscripten/blob/main/.mypy
192+
[update_docs]: https://github.com/emscripten-core/emscripten/blob/main/tools/maint/update_docs.py

0 commit comments

Comments
 (0)