Skip to content

CROSS_ORIGIN not working with EXPORT_ES6 #25821

@alchemicas

Description

@alchemicas

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.19 (08e2de1031913e4ba7963b1c56f35f036a7d4d56)
clang version 22.0.0git (https:/github.com/llvm/llvm-project 12f392cff10fcc70b4ec4f01ab386922742e9136)
Target: wasm32-unknown-emscripten
Thread model: posix

Failing command line in full:
The command does not fail, it just doesn't produce the expected js output.

Full link command and output with -v appended:

em++ main.cpp -o main.js \
	-s CROSS_ORIGIN=1 \
	-s EXPORT_ES6=1 \
	-s MODULARIZE=1 \
	--bind \
	-pthread -v
 "/home/dario/Tools/emsdk/upstream/bin/clang++" -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot -D__EMSCRIPTEN_SHARED_MEMORY__=1 -DEMSCRIPTEN -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -pthread -v -c main.cpp -o /tmp/emscripten_temp_aers77yd/main.o
clang version 22.0.0git (https:/github.com/llvm/llvm-project 12f392cff10fcc70b4ec4f01ab386922742e9136)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/dario/Tools/emsdk/upstream/bin
 (in-process)
 "/home/dario/Tools/emsdk/upstream/bin/clang-22" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-feature +atomics -target-feature +bulk-memory -target-feature +mutable-globals -target-feature +sign-ext -target-cpu generic -fvisibility=hidden -debugger-tuning=gdb -fdebug-compilation-dir=/data/Code/Play/wasm -v -fcoverage-compilation-dir=/data/Code/Play/wasm -resource-dir /home/dario/Tools/emsdk/upstream/lib/clang/22 -D __EMSCRIPTEN_SHARED_MEMORY__=1 -D EMSCRIPTEN -isysroot /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot -internal-isystem /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten/c++/v1 -internal-isystem /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1 -internal-isystem /home/dario/Tools/emsdk/upstream/lib/clang/22/include -internal-isystem /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten -internal-isystem /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include -fdeprecated-macro -ferror-limit 19 -fmessage-length=272 -pthread -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fignore-exceptions -fexceptions -fcolor-diagnostics -iwithsysroot/include/fakesdl -iwithsysroot/include/compat -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -o /tmp/emscripten_temp_aers77yd/main.o -x c++ main.cpp
clang -cc1 version 22.0.0git based upon LLVM 22.0.0git default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten/c++/v1"
ignoring nonexistent directory "/home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
 /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/fakesdl
 /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/compat
 /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1
 /home/dario/Tools/emsdk/upstream/lib/clang/22/include
 /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/include
End of search list.
 /home/dario/Tools/emsdk/upstream/bin/clang --version
 /home/dario/Tools/emsdk/node/22.16.0_64bit/bin/node /home/dario/Tools/emsdk/upstream/emscripten/tools/compiler.mjs - --symbols-only
 /home/dario/Tools/emsdk/upstream/bin/wasm-ld -o main.wasm /tmp/emscripten_temp_aers77yd/main.o -lembind-mt-rtti -L/home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -L/home/dario/Tools/emsdk/upstream/emscripten/src/lib /home/dario/Tools/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/crtbegin.o -lGL-mt-getprocaddr -lal -lhtml5 -lstubs-debug -lnoexit -lc-mt-debug -ldlmalloc-mt-debug -lcompiler_rt-mt -lc++-debug-mt-noexcept -lc++abi-debug-mt-noexcept -lsockets-mt -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpd1b4gx3ilibemscripten_js_symbols.so --import-memory --shared-memory --strip-debug --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=_emscripten_stack_alloc --export=__getTypeName --export=_embind_initialize_bindings --export=_emscripten_thread_free_data --export=_emscripten_thread_crashed --export=__wasm_call_ctors --export=_emscripten_tls_init --export=_emscripten_thread_init --export=_emscripten_stack_restore --export=emscripten_stack_set_limits --export=_emscripten_thread_exit --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-if-defined=fflush --export-table -z stack-size=65536 --no-growable-memory --initial-memory=16777216 --no-entry --stack-first --table-base=1
 /home/dario/Tools/emsdk/upstream/bin/llvm-objcopy main.wasm main.wasm '--remove-section=.debug*' --remove-section=producers --remove-section=name
 /home/dario/Tools/emsdk/node/22.16.0_64bit/bin/node /home/dario/Tools/emsdk/upstream/emscripten/tools/compiler.mjs -
 /home/dario/Tools/emsdk/node/22.16.0_64bit/bin/node /home/dario/Tools/emsdk/upstream/emscripten/tools/preprocessor.mjs - modularize.js --expand-macros

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions