emscripten-core / emscripten-core/emscripten

Poppler benchmark does not build correctly in Wasm64 mode

Open
#25,335 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

```
EMTEST_BENCHMARKERS=node-64 test/runner benchmark.test_zzz_poppler
```

fails in

```
wasm-ld: error: /home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/out/test/building/third_party/poppler/utils/pdftoppm.o: wasm32 object file can't be linked in wasm64 mode
emcc: error: '/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/llvm/git/build_main_64/bin/wasm-ld -o /home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/out/test/node-64_poppler.wasm /tmp/emscripten_temp_if4918h9/poppler_0.o /home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/out/test/building/third_party/poppler/utils/pdftoppm.o /home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/out/test/building/third_party/poppler/utils/parseargs.o /home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/out/test/building/third_party/poppler/poppler/.libs/libpoppler.a /home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/out/test/building/third_party/freetype/objs/.libs/libfreetype.a -L/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/cache/sysroot/lib/wasm64-emscripten -L/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/src/lib /tmp/emscripten_temp_if4918h9/embedded_files.o -lGL-getprocaddr -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -mwasm64 /tmp/tmpgi4cpm7wlibemscripten_js_symbols.so --import-undefined --strip-debug --export-if-defined=_emscripten_stack_alloc --export-if-defined=__wasm_call_ctors --export-if-defined=emscripten_stack_get_current --export-if-defined=_emscripten_stack_restore --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-table -z stack-size=65536 --no-growable-memory --initial-memory=268435456 --no-entry --table-base=1 --global-base=1024' failed (returned 1)
ERROR
```

Tried for a while to get this running. Got Poppler library build correctly in Wasm64 mode with

```diff
iff --git a/test/test_benchmark.py b/test/test_benchmark.py
index b6dcd8169..f21b61ce7 100644
--- a/test/test_benchmark.py
+++ b/test/test_benchmark.py
@@ -1113,6 +1113,9 @@ class benchmark(common.RunnerCore):
''' % DEFAULT_ARG)

def lib_builder(name, native, env_init): # noqa
+ if '-sMEMORY64' in env_init['CFLAGS']:
+ env_init['CPPFLAGS'] = '-sMEMORY64'
+ env_init['LDFLAGS'] = '-sMEMORY64'
return self.get_poppler_library(env_init=env_init)

# TODO: Fix poppler native build and remove skip_native=True
```
but then the problem remains that the freetype library still builds in wasm32 mode. Then got stuck in the `Makefile` jungle.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.