Open Bug 1741233 Opened 6 months ago Updated 6 months ago

`wasm2c` fails to cross compile from a Win64 host to a Win32 target


(Firefox Build System :: General, defect, P3)



(Not tracked)


(Reporter: nalexander, Unassigned)


With ac_add_options --target=i686-pc-mingw32 on a Win64 host (Windows 10, in this case), I see errors like:

0:12.04 In file included from c:/Users/nalexander/Mozilla/gecko/third_party/wasm2c/src/
 0:12.04 In file included from c:/Users/nalexander/.mozbuild/vs2017_15.8.4/SDK\include\10.0.17134.0\um\windows.h:172:
 0:12.04 c:/Users/nalexander/.mozbuild/vs2017_15.8.4/SDK\include\10.0.17134.0\um\winbase.h(9233,32): error: use of undeclared identifier 'InterlockedIncrement64'; did you mean '_InterlockedIncrement64'?
 0:12.04     return (unsigned __int64) (InterlockedIncrement64)((volatile __int64*) Addend);

The failing commands look like:

c:/Users/nalexander/.mozbuild/clang/bin/clang-cl.exe -Xclang -std=c++17 -Fohost_color.obj -c  -O2 -DDEBUG=1 -Wno-implicit-fallthrough -Ic:/Users/nalexander/Mozilla/gecko/config/external/wasm2c_sandbox_compiler -Ic:/Users/nalexander/Mozilla/objdirs/objdir-browser-compile32/config/external/wasm2c_sandbox_compiler -Ic:/Users/nalexander/Mozilla/gecko/third_party/wasm2c -Ic:/Users/nalexander/Mozilla/objdirs/objdir-browser-compile32/dist/include -Xclang -MP -Xclang -dependency-file -Xclang .deps/host_color.obj.pp -Xclang -MT -Xclang host_color.obj -Ic:/Users/nalexander/Mozilla/objdirs/objdir-browser-compile32/dist/include/nspr c:/Users/nalexander/Mozilla/gecko/third_party/wasm2c/src/

The work-around is to use

ac_add_option --without-wasm-sandboxed-libraries

:glandium and I theorize this is Yet Another Problem with using INCLUDE in the environment rather than passing paths on the command line. Not sure if we have a ticket for improving that.

Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.