emscripten-core / emscripten-core/emscripten

Boost libs built with emscripten is in unknown format

Open
#17,052 10 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

Please include the following in your bug report:

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.10 (c3fe57af0504fe24fc4ba697feb8c204f3c80022)
clang version 15.0.0 (https://github.com/llvm/llvm-project 8bc29d14273b05b05d5a56e34c07948dc2c770d3)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /root/emsdk/upstream/bin

When I build boost with the emscripten toolset (`emconfigure ./b2 threading=multi runtime-link=static link=static toolset=emscripten --with-system --with-thread --with-filesystem`) , it generates .bc files and I get this error when I attempt to link the library to my executable:

`wasm-ld: error: unknown file type: /usr/local/boost_emscripten/lib/libboost_system.bc`

So I attempted to rename their extension to .a as is the norm for static libraries in my osrf/ros:galactic container where I'm running this on and I get this error now:

em++: error: /usr/local/boost_emscripten/lib/libboost_system.a: Unknown format, not a static library!

I reproduced this error using [this repo](https://www.github.com/mpconte/sample) under the **emscripten** branch

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.