Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build boost library to emscripten #22767

Open
juanlanuzag opened this issue Oct 18, 2024 · 1 comment
Open

Build boost library to emscripten #22767

juanlanuzag opened this issue Oct 18, 2024 · 1 comment

Comments

@juanlanuzag
Copy link

juanlanuzag commented Oct 18, 2024

Hello, I am trying to port an existing program to wasm and this program uses boost program options.
I downloaded and boostrapped boost and I'm running
`
./b2 toolset=emscripten link=static threading=multi --with-program_options

I am getting the following warning for multiple files

emcc: warning: .bc output file suffix used without -flto or -emit-llvm.  Consider using .o extension since emcc will output an object file, not a bitcode file [-Wemcc]
emscripten.compile.c++ bin.v2/libs/program_options/build/emscripten-3.1.69/release/link-static/threading-multi/visibility-hidden/split.bc

and the following error

emscripten.archive bin.v2/libs/program_options/build/emscripten-3.1.69/release/link-static/threading-multi/visibility-hidden/libboost_program_options.bc
bin.v2/libs/program_options/build/emscripten-3.1.69/release/link-static/threading-multi/visibility-hidden/cmdline.bc:1:2: error: expected top-level entity
    1 | <U+0000>asm<U+0001><U+0000><U+0000><U+0000><U+0001>ƀ<80><80><U+0000><U+000B>`

Any idea what is this issue? Is my approach correct?

Version of emscripten/emsdk:

emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.69 (c55ff404dbe1eb9f263c48b584d5ba627224763a)
clang version 20.0.0git (https:/github.com/llvm/llvm-project 50866e84d1da8462aeb96607bf6d9e5bbd5869c5)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/myuser/emsdk/upstream/bin
@sbc100
Copy link
Collaborator

sbc100 commented Oct 18, 2024

Looks like the build system needs to be updated to switch from .bc to .o for the object file extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants