Open nsourligas opened 1 year ago
arena.cc
is not being compiled with -pthread
but all those other files are being compiled with -pthread
. To fix it, make sure that all your files are being compiled with -pthread
or that none of them are.
@tlively
arena.cc
is part of protobuf source files and I think that it's being compiled by default with -pthread
. And that's why it's very weird that I am always getting the same error with atomics.
CC=emcc CXX=em++ AR=emar cmake .. -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/anteam/protobuf-wasm
-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/anteam/emsdk/upstream/emscripten/emcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/anteam/emsdk/upstream/emscripten/em++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- 3.15.8.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11")
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Configuring done
-- Generating done
Something must be going wrong there because arena.cc is definitely not being compiled with -pthread
.
@tlively you think it's a good idea to force somehow the protobuf library compilation with -pthread
option?
Yes, unless you don't need threads, in which case the better fix would be compile the rest of your app without -pthread
.
Hi,
I am trying to compile my Qt5 application (using protobuf) into wasm following Qt instructions. But the compilation fails at the last generated file which is the application js file and it's probably related to protobuf libraries. Any idea why this is happening?
em++ : 1.39.8
Qt 5.15.0
project.pro qmake compilation flags