Latest emscripten doesnt work on examples

Hi all, wanted to chime in here saying the 3DPrimitivesExample no longer builds with emsdk activate latest. Error log: https://gist.github.com/tarngerine/b1ff7994a35de592783fd3ac70067ebe

It builds with latestfastcomp, but the site errors out:

Also it seems the fastcomp version is deprecated, lots of warnings when trying to use it: em++: warning: the fastomp compiler is deprecated. Please switch to the upstream llvm backend as soon as possible and open issues if you have trouble doing so [-Wfastcomp]

The recommended alternative emsdk is no longer available, either Error: No tool or SDK found by name 'sdk-incoming-64bit'.

I’m getting following errors which are a bit different from above. Running emcc -v gives 1.40.1, on ubuntu 20.04, and OF 0.11.0.

Have tried re-installing, and done (I think) most of the Linux-relevant suggestions before and am able to compile super-simple stuff (‘hello world’) from the emscripten documentation, but seemingly nothing using OF.

Any suggestions welcome!
Thank you

Output:
make: make
Compiling OF library for Release
make[1]: Entering directory ‘/home/ukc/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project’
Done!
make[1]: Leaving directory ‘/home/ukc/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project’

Compiling 3DPrimitivesExample for Release
make[1]: Entering directory ‘/home/ukc/of_v0.11.0_linux64gcc6_release/examples/3d/3DPrimitivesExample’
make[2]: Entering directory ‘/home/ukc/of_v0.11.0_linux64gcc6_release/examples/3d/3DPrimitivesExample’

 compiling done
 to launch the application on the default browser, run:

 emrun bin/3DPrimitivesExample.html
 
 some browsers, like safari, don't support webgl

make[2]: *** [/home/ukc/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk:283: afterplatform] Error 127
make[2]: Leaving directory ‘/home/ukc/of_v0.11.0_linux64gcc6_release/examples/3d/3DPrimitivesExample’
make[1]: *** [/home/ukc/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:169: ReleaseABI] Error 2
make[1]: Leaving directory ‘/home/ukc/of_v0.11.0_linux64gcc6_release/examples/3d/3DPrimitivesExample’
make: *** [/home/ukc/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:129: Release] Error 2

Sorry the actual error is when I start a Firefox (or Chrome) browser, I get an error and no image, even though I have a local server running. The error I get is: ‘[notice ] ofxAppEmscriptenWindow: Got 1 display configs’

Same here (Ubuntu and OSX), did you find any solution?

I tried to compile with the current Emscripten 2.0.26 and OF 0.11.2.
I changed this in config.emscripten.default.mk: Fix emscripten to use non deprecated emsdk docker image by ofTheo · Pull Request #6665 · openframeworks/openFrameworks · GitHub
And I get the error:
wasm-ld: error: /home/jonathan/Schreibtisch/of_v20210719_linux64gcc6_release/libs/freetype/lib/emscripten/libfreetype.bc: unexpected table definition(s) without corresponding symbol-table entries.
Anyhow, it is working fine with Emscripten 1.40.1 (except the fullscreen issue and not antialiasing 2d-shapes), so it is not really an issue for me, but it would be great to use the newer Emscripten versions eventually. Regarding the fullscreen issue: If I use a lowercase s in Module.requestFullscreen then it changes to fullscreen, but a black one: lowercase_s_in_fullscreen by juj · Pull Request #4318 · emscripten-core/emscripten · GitHub
openFrameworks/template.html at master · openframeworks/openFrameworks · GitHub

Actually it works with Emscripten 2.0.6 with this change Fix emscripten to use non deprecated emsdk docker image by ofTheo · Pull Request #6665 · openframeworks/openFrameworks · GitHub :

git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk install sdk-2.0.6-64bit
./emsdk activate sdk-2.0.6-64bit
source ./emsdk_env.sh

With the same result as 1.40.0 (everything works fine, except fullscreen and antialiasing of 2d-shapes).
This could point into a direction why newer versions do not work (current is 2.0.26): Compiler error with malformed symbol generated · Issue #12551 · emscripten-core/emscripten · GitHub
Ensure EH does not change code after linking by aheejin · Pull Request #12493 · emscripten-core/emscripten · GitHub
My example:
https://puredatagui.handmadeproductions.de/

From the Emscripten changelog:


2.0.7: 10/13/2020
-----------------
- Don't run Binaryen postprocessing for Emscripten EH/SjLj. This lets us avoid
  running `wasm-emscripten-finalize` just for C++ exceptions or longjmp. This
  is an ABI change. (#12399)

https://emscripten.org/docs/introducing_emscripten/release_notes.html

I followed these instructions, the right sdk version, same of version 0.11.2-1 patching the file as in the PR.

and now I get the following error when compiling

wasm-ld: error: unknown argument: --as-needed

Any ideas?

@hypermodernist perhaps you need this steps after installing:

From 2.0.7 until (approximately) 2.0.12 I get this error message:

emscripten:ERROR: emscript: failure to parse metadata output from wasm-emscripten-finalize. raw output is: 
{
  "tableSize": 11127,
  "initializers": [
    "__wasm_call_ctors"
  ],
  "declares": [
    "__cxa_atexit",
    "exit",
    "html5video_player_create",
    "html5video_player_delete",
    "html5video_player_load",
    "html5video_player_update",
    "html5video_player_width",
    "html5video_player_height",
    "html5video_player_texture_id",
    "html5video_player_play",
    "html5video_player_stop",
    "html5video_player_is_paused",
    "html5video_player_ready_state",
    "html5video_player_set_pixel_format",
    "html5video_player_pixel_format",
    "html5video_player_current_time",
    "html5video_player_duration",
    "html5video_player_playback_rate",
    "html5video_player_ended",
    "html5video_player_pause",
    "html5video_player_set_current_time",
    "html5video_player_set_volume",
    "html5video_player_set_loop",
    "html5video_player_set_playback_rate",
    "html5video_player_loop",
    "html5video_grabber_create",
    "html5video_grabber_init",
    "html5video_grabber_update",
    "html5video_grabber_width",

....


    "stackSave",
    "stackRestore",
    "stackAlloc",
    "setThrew",
    "_ZSt18uncaught_exceptionv",
    "dynCall_viiiiij",
    "dynCall_viijii",
    "dynCall_ji",
    "dynCall_vij",
    "dynCall_jiji",
    "dynCall_viij",
    "dynCall_jji",
    "dynCall_iji",
    "dynCall_iiji",
    "dynCall_iij",
    "dynCall_jiii",
    "dynCall_jii",
    "dynCall_iiiiij",
    "dynCall_iiiiijj",
    "dynCall_iiiiiijj"
  ],
  "namedGlobals": {
  },
  "invokeFuncs": [
    "invoke_vii"
  ],
  "mainReadsParams": 0,
  "features": [
  ]
}

Traceback (most recent call last):
  File "/home/jonathan/emsdk/upstream/emscripten/em++.py", line 14, in <module>
    sys.exit(emcc.run(sys.argv))
  File "/home/jonathan/emsdk/upstream/emscripten/emcc.py", line 2156, in run
    post_link(options, wasm_target, wasm_target, target)
  File "/home/jonathan/emsdk/upstream/emscripten/emcc.py", line 2185, in post_link
    emscripten.run(in_wasm, wasm_target, final_js, memfile)
  File "/home/jonathan/emsdk/upstream/emscripten/emscripten.py", line 876, in run
    return temp_files.run_and_clean(lambda: emscript(
  File "/home/jonathan/emsdk/upstream/emscripten/tools/tempfiles.py", line 104, in run_and_clean
    return func()
  File "/home/jonathan/emsdk/upstream/emscripten/emscripten.py", line 876, in <lambda>
    return temp_files.run_and_clean(lambda: emscript(
  File "/home/jonathan/emsdk/upstream/emscripten/emscripten.py", line 319, in emscript
    metadata = finalize_wasm(in_wasm, out_wasm, memfile, DEBUG)
  File "/home/jonathan/emsdk/upstream/emscripten/emscripten.py", line 484, in finalize_wasm
    return load_metadata_wasm(stdout, DEBUG)
  File "/home/jonathan/emsdk/upstream/emscripten/emscripten.py", line 786, in load_metadata_wasm
    metadata_json = json.loads(metadata_raw)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 197 column 22 (char 5228)

Thank you for your response
I did the steps you suggested before I tried. I still get that error message.
Perhaps I will try from git master instead of from AUR latest of version