-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Passing '--bind' (and thus setting -std=c++11) causes 'unresolved symbol: exp2f' error #3259
Description
I have a project which built fine using Emscripten compiler. I want to use embind to do some binding works. However, I already encounter a build failure simply by passing --bind compiler flag before actually adding any binding code. My project uses expf function from Box2D and Bullet libs. I cannot find any references to exp2f, so I am not sure why I got this unresolved symbol error.
More interestingly, I do not get this unresolved symbol error when I build my project with Release build configuration (-O3 and -s AGGRESSIVE_VARIABLE_ELIMINATION=1) for both with and without --bind flag. The llvm-nm produces this similar output for both.
$ llvm-nm ../emscripten-Build/lib/libUrho3D.a |grep -P exp.?f
U exp2f
U expf
This is the project library which is used when linking the final html.
In Debug build configuration (no optimization flag and -g4), both with and without --bind flag produce library without the exp2f symbol.
$ llvm-nm ../emscripten-Build/lib/libUrho3D.a |grep -P exp.?f
U expf
However, the build without --bind still ends in a success, perhaps it does not look for exp2f symbol during linking. Only the Debug build with --bind flag fails with the unresolved symbol error.
Is this a normal behavior? Why would Release configuration has more symbols than Debug configuration in this particular case? And why would --bind (or -std=c++11) cause the linker to look for different symbol?