Skip to content

Commit 809a594

Browse files
committed
Merge remote-tracking branch 'upstream/main' into openal-alext-support
2 parents b236d1d + 42fd234 commit 809a594

File tree

261 files changed

+4007
-3120
lines changed

Some content is hidden

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

261 files changed

+4007
-3120
lines changed

.circleci/config.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ commands:
112112
description: "install canary version of node"
113113
steps:
114114
- install-node-version:
115-
node_version: "22.0.0-v8-canary20231108ff311d5a39"
115+
node_version: "22.0.0-v8-canary20240423a2eb2005bd"
116116
canary: true
117117
install-v8:
118118
description: "install v8 using jsvu"
@@ -318,6 +318,7 @@ commands:
318318
# PIC version of libSDL which is used by test_sdl2_misc_main_module
319319
export EM_FROZEN_CACHE=""
320320
test/runner << parameters.test_targets >>
321+
- upload-test-results
321322
setup-macos:
322323
steps:
323324
- run:
@@ -367,6 +368,7 @@ commands:
367368
# TODO: Do GL testing when https://bugzil.la/1375585 (lack of WebGL
368369
# support in headless mode) resolves
369370
EMTEST_LACKS_GRAPHICS_HARDWARE: "1"
371+
EMTEST_LACKS_WEBGPU: "1"
370372
EMTEST_LACKS_SOUND_HARDWARE: "1"
371373
# OffscreenCanvas support is not yet done in Firefox.
372374
EMTEST_LACKS_OFFSCREEN_CANVAS: "1"
@@ -720,6 +722,7 @@ jobs:
720722
test_targets: "
721723
core0.test_hello_argc
722724
core2.test_demangle_stacks_symbol_map"
725+
- upload-test-results
723726
test-node-compat:
724727
# We don't use `bionic` here since its too old to run recent node versions:
725728
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
@@ -759,7 +762,8 @@ jobs:
759762
other.test_js_optimizer_verbose
760763
other.test_node_unhandled_rejection
761764
other.test_full_js_library*
762-
core2.test_hello_world"
765+
core2.test_hello_world
766+
core2.test_fs_write_rawfs"
763767
# Run a few test with the most recent version of node
764768
# In particular we have some tests that require node flags on older
765769
# versions of node but not with the most recent version.
@@ -794,6 +798,8 @@ jobs:
794798
test_targets: "other skip:other.test_native_link_error_message"
795799
test-browser-chrome:
796800
executor: bionic
801+
environment:
802+
EMTEST_LACKS_WEBGPU: "1"
797803
steps:
798804
- run-tests-chrome:
799805
title: "browser"
@@ -803,19 +809,24 @@ jobs:
803809
"
804810
test-browser-chrome-wasm64:
805811
executor: bionic
812+
environment:
813+
EMTEST_LACKS_WEBGPU: "1"
806814
steps:
807815
- run-tests-chrome:
808816
title: "browser64"
809817
test_targets: "browser64"
810818
test-browser-chrome-2gb:
811819
executor: bionic
820+
environment:
821+
EMTEST_LACKS_WEBGPU: "1"
812822
steps:
813823
- run-tests-chrome:
814824
title: "browser_2gb"
815825
test_targets: "browser_2gb"
816826
test-browser-chrome-wasm64-4gb:
817827
executor: bionic
818828
environment:
829+
EMTEST_LACKS_WEBGPU: "1"
819830
EMTEST_SKIP_NODE_CANARY: "1"
820831
steps:
821832
- run-tests-chrome:

.eslintrc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ignorePatterns:
2222
- "src/closure-externs/"
2323
- "src/embind/"
2424
- "src/emrun_postjs.js"
25-
- "src/worker.js"
2625
- "src/wasm_worker.js"
2726
- "src/audio_worklet.js"
2827
- "src/wasm2js.js"

ChangeLog.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,49 @@ to browse the changes between the tags.
1818

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

21-
3.1.57 (in development)
21+
3.1.60 (in development)
2222
-----------------------
23+
- The `EXPORTED_FUNCTIONS` list can now include JS library symbols even if they
24+
have not been otherwise included (e.g. via `DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`).
25+
(#21867)
26+
27+
3.1.59 - 04/30/24
28+
-----------------
29+
- Fix the location of the dummy `.worker.js` file that is now generated as part
30+
of pthread builds so that is generated alongside the main JavaScript file.
31+
See #21701. ()
32+
- `-sASYNCIFY=2` is setting now deprecated, use `-sJSPI` instead.
33+
- Due to the upstream LLVM change
34+
(https://github.com/llvm/llvm-project/pull/80923), multivalue and
35+
reference-types features are now enabled by default in Emscripten. This only
36+
enables the language features and does not turn on the multivalue ABI.
37+
38+
3.1.58 - 04/23/24
39+
-----------------
40+
- The `-sMAIN_MODULE=1` mode no longer exports all the main module symbols on
41+
`Module` object. This saves a huge about of generated JS code due the fact
42+
that `-sMAIN_MODULE=1` includes *all* native symbols in your program as well
43+
is from the standard library. The generated JS code for a simple program
44+
in this mode is reduced from from 3.3mb to 0.5mb. The current implementation
45+
of this feature requires wasm-ld to be on the program twice which could have a
46+
noticeable effect on link times. (#21785)
47+
- In `-sMODULARIZE` mode, the argument passed into the module constructor is
48+
no longer mutated in place. The expectation is that the module instance will
49+
be available via the constructor return value. Attempting to access methods
50+
on the object passed *into* the constructor will now abort. (#21775)
51+
- Enable use of `::` to escape port option separator (#21710)
52+
- In multi-threaded builds `--extern-pre-js` and `--extern-post-js` code is
53+
now only run on the main thread, and not on each of the workers. (#21750)
54+
- Fix crash when throwing exceptions in dynamically linked int64 functions (#21759)
55+
- Multi-threaded builds no depend on a separate `.worker.js` file. This saves
56+
on code size and network requests. In order to make this change go smoothly,
57+
without breaking build systems that expect a `worker.js`, emscripten will
58+
generate an empty `.worker.js` to give folks time to transition their
59+
deployment scripts. In `-sSTRICT` mode, this empty file will not be
60+
generated. (#21701)
61+
62+
3.1.57 - 04/10/24
63+
-----------------
2364
- libcxx, libcxxabi, libunwind, and compiler-rt were updated to LLVM 18.1.2.
2465
(#21607, #21638, and #21663)
2566
- musl libc updated from v1.2.4 to v1.2.5. (#21598)
@@ -44,6 +85,15 @@ See docs/process.md for more on how version tagging works.
4485
- TypeScript definitions for Wasm exports, runtime exports, and embind bindings
4586
can now be generated with `--emit-tsd`. The option `--embind-emit-tsd` has been
4687
deprecated, use `--emit-tsd` instead.
88+
- Added the `ASYNCIFY_PROPAGATE_ADD` setting, to control whether the `ASYNCIFY_ADD`
89+
list propagates or not. By default this is enabled; as a result you may see larger
90+
ASYNCIFY builds as more of the function tree may be instrumented than you were
91+
previously manually specifying in `ASYNCIFY_ADD`. To stop propagation you can
92+
specify functions in the `ASYNCIFY_REMOVE` list, or to return to the previous
93+
behaviour, disable this setting (set `-sNO_ASYNCIFY_PROPAGATE_ADD`.) (#21672)
94+
- ports changes:
95+
- Fixed transitive link dependencies (#21602)
96+
- Enable use of options in ports dependencies (#21629)
4797

4898
3.1.56 - 03/14/24
4999
-----------------

cmake/Modules/Platform/Emscripten.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
284284

285285
# Set a global EMSCRIPTEN variable that can be used in client CMakeLists.txt to
286286
# detect when building using Emscripten.
287-
set(EMSCRIPTEN 1 CACHE BOOL "If true, we are targeting Emscripten output.")
287+
set(EMSCRIPTEN 1 CACHE INTERNAL "If true, we are targeting Emscripten output.")
288288

289289
# Hardwire support for cmake-2.8/Modules/CMakeBackwardsCompatibilityC.cmake
290290
# without having CMake to try complex things to autodetect these:

emcc.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,15 @@ def apply_user_settings():
292292

293293
if key == 'EXPORTED_FUNCTIONS':
294294
# used for warnings in emscripten.py
295-
settings.USER_EXPORTED_FUNCTIONS = settings.EXPORTED_FUNCTIONS.copy()
295+
settings.USER_EXPORTS = settings.EXPORTED_FUNCTIONS.copy()
296296

297297
# TODO(sbc): Remove this legacy way.
298298
if key == 'WASM_OBJECT_FILES':
299299
settings.LTO = 0 if value else 'full'
300300

301+
if key == 'JSPI':
302+
settings.ASYNCIFY = 2
303+
301304

302305
def cxx_to_c_compiler(cxx):
303306
# Convert C++ compiler name into C compiler name
@@ -369,12 +372,13 @@ def get_clang_flags(user_args):
369372
if settings.RELOCATABLE and '-fPIC' not in user_args:
370373
flags.append('-fPIC')
371374

372-
# We use default visiibilty=default in emscripten even though the upstream
373-
# backend defaults visibility=hidden. This matched the expectations of C/C++
374-
# code in the wild which expects undecorated symbols to be exported to other
375-
# DSO's by default.
376-
if not any(a.startswith('-fvisibility') for a in user_args):
377-
flags.append('-fvisibility=default')
375+
if settings.RELOCATABLE or settings.LINKABLE or '-fPIC' in user_args:
376+
if not any(a.startswith('-fvisibility') for a in user_args):
377+
# For relocatable code we default to visibility=default in emscripten even
378+
# though the upstream backend defaults visibility=hidden. This matches the
379+
# expectations of C/C++ code in the wild which expects undecorated symbols
380+
# to be exported to other DSO's by default.
381+
flags.append('-fvisibility=default')
378382

379383
if settings.LTO:
380384
if not any(a.startswith('-flto') for a in user_args):

emscripten-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.57-git
1+
3.1.60-git

site/source/docs/introducing_emscripten/community.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Feel free to ask questions, share your ideas, or just join the conversation!
2222

2323
Emscripten also has a presence on social media:
2424

25-
- `#emscripten <https://twitter.com/hashtag/emscripten>`_ (Emscripten Hashtag on Twitter)
26-
- `@kripken <https://twitter.com/kripken>`_ (an Emscripten developer's account on Twitter, mentions Emscripten updates)
25+
- `@emscripten on Bluesky <https://bsky.app/profile/emscripten.bsky.social>`_
26+
- `@emscripten on Mastodon <https://fosstodon.org/@emscripten>`_
27+
- `@emscripten on Twitter <https://twitter.com/emscripten>`_
2728

2829

2930
Report a bug

site/source/docs/porting/asyncify.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,16 @@ If you know that some indirect calls matter and others do not, then you
355355
can provide a manual list of functions to Asyncify:
356356

357357
* ``ASYNCIFY_REMOVE`` is a list of functions that do not unwind the stack.
358-
Asyncify will do its normal whole-program analysis, then remove these
359-
functions from the list of instrumented functions.
360-
* ``ASYNCIFY_ADD`` is a list of functions that do unwind the stack, and
361-
are added after doing the normal whole-program analysis. This is mostly useful
358+
As Asyncify processes the call tree, functions in this list will be removed,
359+
and neither they nor their callers will be instrumented (unless their callers
360+
need to be instrumented for other reasons.)
361+
* ``ASYNCIFY_ADD`` is a list of functions that do unwind the stack, and will be
362+
processed like the imports. This is mostly useful
362363
if you use ``ASYNCIFY_IGNORE_INDIRECT`` but want to also mark some additional
363-
functions that need to unwind.
364+
functions that need to unwind. If the ``ASYNCIFY_PROPAGATE_ADD`` setting is
365+
disabled however, then this list will only be added after the whole-program
366+
analysis. If ``ASYNCIFY_PROPAGATE_ADD`` is disabled then you must also add
367+
their callers, their callers' callers, and so on.
364368
* ``ASYNCIFY_ONLY`` is a list of the **only** functions that can unwind
365369
the stack. Asyncify will instrument exactly those and no others.
366370

site/source/docs/porting/pthreads.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ The Emscripten implementation for the pthreads API should follow the POSIX stand
146146

147147
- Pthreads + memory growth (``ALLOW_MEMORY_GROWTH``) is especially tricky, see `Wasm design issue #1271 <https://github.com/WebAssembly/design/issues/1271>`_. This currently causes JS accessing the Wasm memory to be slow - but this will likely only be noticeable if the JS does large amounts of memory reads and writes (Wasm runs at full speed, so moving work over can fix this). This also requires that your JS be aware that the HEAP* views may need to be updated - JS code embedded with ``--js-library`` etc will automatically be transformed to use the ``GROWABLE_HEAP_*`` helper functions where ``HEAP*`` are used, but external code that uses ``Module.HEAP*`` directly may encounter problems with views being smaller than memory.
148148

149-
Also note that when compiling code that uses pthreads, an additional JavaScript file ``NAME.worker.js`` is generated alongside the output .js file (where ``NAME`` is the basename of the main file being emitted). That file must be deployed with the rest of the generated code files. By default, ``NAME.worker.js`` will be loaded relative to the main HTML page URL. If it is desirable to load the file from a different location e.g. in a CDN environment, then one can define the ``Module.locateFile(filename)`` function in the main HTML ``Module`` object to return the URL of the target location of the ``NAME.worker.js`` entry point. If this function is not defined in ``Module``, then the default location relative to the main HTML file is used.
150-
151149
.. _Allocator_performance:
152150

153151
Allocator performance

site/source/docs/tools_reference/emsdk.rst

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -232,44 +232,52 @@ How do I install and activate old Emscripten SDKs and tools?
232232

233233
.. _emsdk-dev-sdk:
234234

235-
How do I track the latest Emscripten development with the SDK?
236-
--------------------------------------------------------------
235+
How do I track the latest changes with the SDK?
236+
-----------------------------------------------
237237

238-
It is also possible to use the latest and greatest versions of the tools on the GitHub repositories! This allows you to obtain new features and latest fixes immediately as they are pushed to GitHub, without having to wait for release to be tagged. **No GitHub account or fork of Emscripten is required.**
238+
To try the latest changes with emsdk you can install and activate a special
239+
version called ``tot`` (Tip-Of-Tree) which is continuously built and usually
240+
contains Emscripten and LLVM changes just a few hours after they are committed:
239241

240-
To switch to using the latest upstream git development branch (``main``), run the following:
242+
::
243+
244+
./emsdk install tot
245+
./emsdk activate tot
246+
247+
If you want to build everything yourself from the very latest sources you can
248+
use ``sdk-main-64bit``:
241249

242250
::
243251

244-
# Install git. Skip if the system already has it.
252+
# Install git (Skip if the system already has it).
245253
./emsdk install git-1.8.3
246254

247255
# Clone+pull the latest emscripten-core/emscripten/main.
248-
./emsdk install sdk-upstream-main-64bit
256+
./emsdk install sdk-main-64bit
249257

250-
# Set the "upstream-main SDK" as the active version.
251-
./emsdk activate sdk-upstream-main-64bit
258+
# Set this as the active version.
259+
./emsdk activate sdk-main-64bit
252260

253261
.. _emsdk-howto-use-own-fork:
254262

255-
How do I use my own Emscripten GitHub fork with the SDK?
256-
--------------------------------------------------------
263+
How do I use my own Emscripten fork with the SDK?
264+
-------------------------------------------------
257265

258-
It is also possible to use your own fork of the Emscripten repository via the SDK. This is useful in the case when you want to make your own modifications to the Emscripten toolchain, but still keep using the SDK environment and tools.
266+
It is also possible to use your own fork of the Emscripten repository via the
267+
SDK. This is useful in the case when you want to make your own modifications to
268+
the Emscripten toolchain, but still keep using the SDK environment and tools.
259269

260-
The way this works is that you first install the ``sdk-upstream-main`` SDK as in the :ref:`previous section <emsdk-dev-sdk>`. Then you use familiar git commands to replace this branch with the information from your own fork:
270+
To to this all you need to do is set the ``EM_CONFIG`` environment variable to
271+
point to the emsdk emscripten config and then put your own checkout of
272+
emscripten first in the ``PATH``:
261273

262274
::
263275

264-
cd emscripten/main
265-
266-
# Add a git remote link to your own repository.
267-
git remote add myremote https://github.com/mygituseraccount/emscripten.git
268-
269-
# Obtain the changes in your link.
270-
git fetch myremote
276+
cd my_emscripten/
271277

272-
# Switch the emscripten-main tool to use your fork.
273-
git checkout -b mymain --track myremote/main
278+
# Tell emscripten to use the emsdk config file
279+
export EM_CONFIG=/path/to/emsdk/.emscripten
274280

275-
You can switch back and forth between remotes via the ``git checkout`` command as usual.
281+
# Now your version of emscripten will use LLVM and binaryen
282+
# binaries from the currently active version of emsdk.
283+
./emcc

0 commit comments

Comments
 (0)