Replies: 3 comments 4 replies
-
I think this is a combination of emscripten-core/emscripten#20922 and genie producing an incorrect extensions for static libraries. These days Emscripten just uses .a and .so as usual. What version of Emscripten are you using? Does it work with a version <= 3.1.51? This apparently broke with 3.1.52. |
Beta Was this translation helpful? Give feedback.
-
Using emscripten version 3.1.51 worked, Thank you! |
Beta Was this translation helpful? Give feedback.
-
What one can do to build bgfx on last version of Emscripten? |
Beta Was this translation helpful? Give feedback.
-
I am trying to build BGFX for WASM and it fails when trying to compile the examples. I am building on a windows platform and have followed the instructions and downloaded the required windows components.
Each of the .bc files generated in the .build directory start with ! which the linker doesn't seem to like.
Thank you for any help you can provide!
Here is what I get when I run make wasm-release (does the same for debug):
C:\dev\bgfx\bgfx>make clean
Cleaning...
C:\dev\bgfx\bgfx>make wasm-release
../bx/tools/bin/windows/genie --gcc=wasm --with-combined-examples gmake
Building configurations...
Running action 'gmake'...
Generating ".build/projects/gmake-wasm/Makefile"
Generating ".build/projects/gmake-wasm/bx.make"
Generating ".build/projects/gmake-wasm/bimg.make"
Generating ".build/projects/gmake-wasm/bimg_decode.make"
Generating ".build/projects/gmake-wasm/bgfx.make"
Generating ".build/projects/gmake-wasm/example-glue.make"
Generating ".build/projects/gmake-wasm/example-common.make"
Generating ".build/projects/gmake-wasm/examples.make"
Generating ".build/projects/gmake-wasm/example-25-c99.make"
Done. Generated 9/9 projects.
make -R -C .build/projects/gmake-wasm config=release
make[1]: Entering directory C:/dev/bgfx/bgfx/.build/projects/gmake-wasm
"==== Building bx (release) ===="
Creating ../../wasm/obj/Release/bx
Creating ../../wasm/obj/Release/bx/bx/src
Creating ../../wasm/bin
allocator.cpp
bounds.cpp
bx.cpp
commandline.cpp
crtnone.cpp
debug.cpp
dtoa.cpp
easing.cpp
file.cpp
filepath.cpp
hash.cpp
math.cpp
mutex.cpp
In file included from ../../../../bx/src/mutex.cpp:6:
../../../../bx/include\bx/mutex.h:34:30: warning: private field 'm_internal' is not used [-Wunused-private-field]
34 | BX_ALIGN_DECL(16, uint8_t) m_internal[64];
| ^
1 warning generated.
os.cpp
process.cpp
semaphore.cpp
settings.cpp
sort.cpp
string.cpp
thread.cpp
timer.cpp
url.cpp
Archiving bx
"==== Building bgfx (release) ===="
Creating ../../wasm/obj/Release/bgfx
Creating ../../wasm/obj/Release/bgfx/src
bgfx.cpp
debug_renderdoc.cpp
dxgi.cpp
glcontext_egl.cpp
glcontext_html5.cpp
glcontext_wgl.cpp
nvapi.cpp
renderer_agc.cpp
renderer_d3d11.cpp
renderer_d3d12.cpp
renderer_gl.cpp
renderer_gnm.cpp
renderer_noop.cpp
renderer_nvn.cpp
renderer_vk.cpp
shader.cpp
shader_dxbc.cpp
shader_spirv.cpp
topology.cpp
vertexlayout.cpp
Archiving bgfx
"==== Building bimg (release) ===="
Creating ../../wasm/obj/Release/bimg
Creating ../../wasm/obj/Release/bimg/bimg/3rdparty/astc-encoder/source
Creating ../../wasm/obj/Release/bimg/bimg/3rdparty/tinyexr/deps/miniz
Creating ../../wasm/obj/Release/bimg/bimg/src
astcenc_averages_and_directions.cpp
astcenc_block_sizes.cpp
astcenc_color_quantize.cpp
astcenc_color_unquantize.cpp
astcenc_compress_symbolic.cpp
astcenc_compute_variance.cpp
astcenc_decompress_symbolic.cpp
astcenc_diagnostic_trace.cpp
astcenc_entry.cpp
astcenc_find_best_partitioning.cpp
astcenc_ideal_endpoints_and_weights.cpp
astcenc_image.cpp
astcenc_integer_sequence.cpp
astcenc_mathlib.cpp
astcenc_mathlib_softfloat.cpp
astcenc_partition_tables.cpp
astcenc_percentile_tables.cpp
astcenc_pick_best_endpoint_format.cpp
astcenc_quantization.cpp
astcenc_symbolic_physical.cpp
astcenc_weight_align.cpp
astcenc_weight_quant_xfer_tables.cpp
miniz.c
../../../../bimg/3rdparty/tinyexr/deps/miniz/miniz.c:3089:9: warning: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files. [-W#pragma-messages]
3089 | #pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
| ^
1 warning generated.
image.cpp
image_gnf.cpp
Archiving bimg
"==== Building bimg_decode (release) ===="
Creating ../../wasm/obj/Release/bimg_decode
Creating ../../wasm/obj/Release/bimg_decode/bimg/src
image_decode.cpp
In file included from ../../../../bimg/src/image_decode.cpp:22:
../../../../bimg/3rdparty\tinyexr/tinyexr.h:6775:29: warning: variable 'block_data_size' set but not used [-Wunused-but-set-variable]
6775 | tinyexr::tinyexr_uint64 block_data_size = 0;
| ^
../../../../bimg/3rdparty\tinyexr/tinyexr.h:7211:10: warning: variable 'sum' set but not used [-Wunused-but-set-variable]
7211 | size_t sum = memory.size();
| ^
2 warnings generated.
Archiving bimg_decode
"==== Building example-glue (release) ===="
Creating ../../wasm/obj/Release/example-glue
Creating ../../wasm/obj/Release/example-glue/examples/common
example-glue.cpp
Archiving example-glue
"==== Building example-common (release) ===="
Creating ../../wasm/obj/Release/example-common
Creating ../../wasm/obj/Release/example-common/3rdparty/dear-imgui
Creating ../../wasm/obj/Release/example-common/3rdparty/meshoptimizer/src
Creating ../../wasm/obj/Release/example-common/examples/common
Creating ../../wasm/obj/Release/example-common/examples/common/debugdraw
Creating ../../wasm/obj/Release/example-common/examples/common/entry
Creating ../../wasm/obj/Release/example-common/examples/common/font
Creating ../../wasm/obj/Release/example-common/examples/common/imgui
Creating ../../wasm/obj/Release/example-common/examples/common/nanovg
Creating ../../wasm/obj/Release/example-common/examples/common/ps
imgui.cpp
In file included from ../../../3rdparty/dear-imgui/imgui.cpp:15702:
In file included from ../../../3rdparty/dear-imgui\imgui_user.inl:78:
../../../3rdparty/dear-imgui\widgets/gizmo.inl:326:7: warning: definition of implicit copy assignment operator for 'matrix_t' is deprecated because it has a user-provided copy constructor [-Wdeprecated-copy-with-user-provided-copy]
326 | matrix_t(const matrix_t& other) { memcpy(&m16[0], &other.m16[0], sizeof(float) * 16); }
| ^
../../../3rdparty/dear-imgui\widgets/gizmo.inl:353:17: note: in implicit copy assignment operator for 'ImGuizmo::matrix_t' first required here
353 | tmpMat = this;
| ^
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1309:59: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
1309 | const bool usingAxis = (gContext.mbUsing && type == MT_SCALE_X + i);
| ~~~~ ^ ~~~~~~~~~~~~~~
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1417:16: warning: '/' within block comment [-Wcomment]
1417 | /*
| ^
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1408:23: warning: unused variable 'baseSSpace' [-Wunused-variable]
1408 | ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVPLocal);
| ^~~~~~~~~~
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1396:59: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
1396 | const bool usingAxis = (gContext.mbUsing && type == MT_SCALE_X + i);
| ~~~~ ^ ~~~~~~~~~~~~~~
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1478:61: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
1478 | if (!gContext.mbUsing || (gContext.mbUsing && type == MT_MOVE_X + i))
| ~~~~ ^ ~~~~~~~~~~~~~
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1507:61: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
1507 | if (!gContext.mbUsing || (gContext.mbUsing && type == MT_MOVE_YZ + i))
| ~~~~ ^ ~~~~~~~~~~~~~~
../../../3rdparty/dear-imgui\widgets/gizmo.inl:1889:20: warning: unused variable 'baseSSpace' [-Wunused-variable]
1889 | ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVPLocal);
| ^~~~~~~~~~
../../../3rdparty/dear-imgui\widgets/gizmo.inl:64:16: warning: unused function 'operator==' [-Wunused-function]
64 | static bool operator==(OPERATION lhs, int rhs)
| ^~~~~~~~
9 warnings generated.
imgui_demo.cpp
imgui_draw.cpp
imgui_tables.cpp
imgui_widgets.cpp
allocator.cpp
clusterizer.cpp
indexcodec.cpp
indexgenerator.cpp
overdrawanalyzer.cpp
overdrawoptimizer.cpp
quantization.cpp
simplifier.cpp
spatialorder.cpp
stripifier.cpp
vcacheanalyzer.cpp
vcacheoptimizer.cpp
vertexcodec.cpp
vertexfilter.cpp
vfetchanalyzer.cpp
vfetchoptimizer.cpp
bgfx_utils.cpp
camera.cpp
cube_atlas.cpp
debugdraw.cpp
cmd.cpp
dialog.cpp
entry.cpp
entry_android.cpp
entry_glfw.cpp
entry_html5.cpp
entry_noop.cpp
entry_sdl.cpp
entry_windows.cpp
entry_x11.cpp
input.cpp
font_manager.cpp
text_buffer_manager.cpp
text_metrics.cpp
utf8.cpp
imgui.cpp
nanovg.cpp
nanovg_bgfx.cpp
particle_system.cpp
Archiving example-common
"==== Building example-25-c99 (release) ===="
Creating ../../wasm/obj/Release/example-25-c99
Creating ../../wasm/obj/Release/example-25-c99/examples/25-c99
helloworld.c
Linking example-25-c99
../../wasm/bin/example-glueRelease.bc:1:2: error: expected integer
1 | !
| ^
1 error generated.
em++: error: 'C:/dev/Emscripten/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=C:\dev\Emscripten\emsdk\upstream\emscripten\cache\sysroot -DEMSCRIPTEN -Xclang -iwithsysroot/include\fakesdl -Xclang -iwithsysroot/include\compat ../../wasm/bin/example-glueRelease.bc -c -o C:\Users\Nrage\AppData\Local\Temp\emscripten_temp_zno7fc0z\example-glueRelease_0.o' failed (returned 1)
make[2]: *** [../../wasm/bin/example-25-c99Release.html] Error 1
make[1]: *** [example-25-c99] Error 2
make[1]: Leaving directory `C:/dev/bgfx/bgfx/.build/projects/gmake-wasm'
make: *** [wasm-release] Error 2
C:\dev\bgfx\bgfx>
Beta Was this translation helpful? Give feedback.
All reactions