wasmerio / wasmer

🚀 The leading Wasm Runtime supporting WASIX, WASI and Emscripten
https://wasmer.io
MIT License
18.55k stars 793 forks source link

Create-exe: Cross-compiling from Windows to Windows doesn't work #3459

Closed fschutt closed 3 months ago

fschutt commented 1 year ago

This is a followup for https://github.com/wasmerio/wasmer/pull/3430 - currently the test_cross_compile_python_windows and test_wasmer_create_exe_pirita_works don't work on windows when compiling from Windows to Windows:

x86_64-windows-gnu target cranelift                                                                                                                                                                                   
Error: linking failed with: stdout: Compiler: cranelift                                                                                                                                                               
Target: x86_64-unknown-windows-gnu                                                                                                                                                                                    
Format: Symbols                                                                                                                                                                                                       
Using path `C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\lib\libwasmer.a` as libwasmer path.                                                                                                              

stderr: C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.0\zig.exe clang C:\Users\felix\AppData\Local\Temp\.tmpnAprtL\wasmer_main.c -fno-caret-diagnostics -target x86_64-unknown-windows-gnu -nostdinc
 -fno-spell-checking -isystem C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.0\lib\include -isystem C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.0\lib\libc\include\x86_64-windows
-gnu -isystem C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.0\lib\libc\include\generic-mingw -isystem C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.0\lib\libc\include\x86_64-wind
ows-any -isystem C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.0\lib\libc\include\any-windows-any -Xclang -target-cpu -Xclang x86-64 -Xclang -target-feature -Xclang -16bit-mode -Xclang -target-fea
ture -Xclang -32bit-mode -Xclang -target-feature -Xclang -3dnow -Xclang -target-feature -Xclang -3dnowa -Xclang -target-feature -Xclang +64bit -Xclang -target-feature -Xclang -adx -Xclang -target-feature -Xclang -a
es -Xclang -target-feature -Xclang -amx-bf16 -Xclang -target-feature -Xclang -amx-int8 -Xclang -target-feature -Xclang -amx-tile -Xclang -target-feature -Xclang -avx -Xclang -target-feature -Xclang -avx2 -Xclang -t
arget-feature -Xclang -avx512bf16 -Xclang -target-feature -Xclang -avx512bitalg -Xclang -target-feature -Xclang -avx512bw -Xclang -target-feature -Xclang -avx512cd -Xclang -target-feature -Xclang -avx512dq -Xclang 
-target-feature -Xclang -avx512er -Xclang -target-feature -Xclang -avx512f -Xclang -target-feature -Xclang -avx512fp16 -Xclang -target-feature -Xclang -avx512ifma -Xclang -target-feature -Xclang -avx512pf -Xclang -
target-feature -Xclang -avx512vbmi -Xclang -target-feature -Xclang -avx512vbmi2 -Xclang -target-feature -Xclang -avx512vl -Xclang -target-feature -Xclang -avx512vnni -Xclang -target-feature -Xclang -avx512vp2inters
ect -Xclang -target-feature -Xclang -avx512vpopcntdq -Xclang -target-feature -Xclang -avxvnni -Xclang -target-feature -Xclang -bmi -Xclang -target-feature -Xclang -bmi2 -Xclang -target-feature -Xclang -branchfusion
 -Xclang -target-feature -Xclang -cldemote -Xclang -target-feature -Xclang -clflushopt -Xclang -target-feature -Xclang -clwb -Xclang -target-feature -Xclang -clzero -Xclang -target-feature -Xclang +cmov -Xclang -ta
rget-feature -Xclang -crc32 -Xclang -target-feature -Xclang -cx16 -Xclang -target-feature -Xclang +cx8 -Xclang -target-feature -Xclang -enqcmd -Xclang -target-feature -Xclang -ermsb -Xclang -target-feature -Xclang 
-f16c -Xclang -target-feature -Xclang -false-deps-getmant -Xclang -target-feature -Xclang -false-deps-lzcnt-tzcnt -Xclang -target-feature -Xclang -false-deps-mulc -Xclang -target-feature -Xclang -false-deps-mullq -
Xclang -target-feature -Xclang -false-deps-perm -Xclang -target-feature -Xclang -false-deps-popcnt -Xclang -target-feature -Xclang -false-deps-range -Xclang -target-feature -Xclang -fast-11bytenop -Xclang -target-f
eature -Xclang -fast-15bytenop -Xclang -target-feature -Xclang -fast-7bytenop -Xclang -target-feature -Xclang -fast-bextr -Xclang -target-feature -Xclang -fast-gather -Xclang -target-feature -Xclang -fast-hops -Xcl
ang -target-feature -Xclang -fast-lzcnt -Xclang -target-feature -Xclang -fast-movbe -Xclang -target-feature -Xclang -fast-scalar-fsqrt -Xclang -target-feature -Xclang -fast-scalar-shift-masks -Xclang -target-featur
e -Xclang -fast-shld-rotate -Xclang -target-feature -Xclang -fast-variable-crosslane-shuffle -Xclang -target-feature -Xclang -fast-variable-perlane-shuffle -Xclang -target-feature -Xclang -fast-vector-fsqrt -Xclang
 -target-feature -Xclang -fast-vector-shift-masks -Xclang -target-feature -Xclang -fma -Xclang -target-feature -Xclang -fma4 -Xclang -target-feature -Xclang -fsgsbase -Xclang -target-feature -Xclang -fsrm -Xclang -
target-feature -Xclang +fxsr -Xclang -target-feature -Xclang -gfni -Xclang -target-feature -Xclang -harden-sls-ijmp -Xclang -target-feature -Xclang -harden-sls-ret -Xclang -target-feature -Xclang -hreset -Xclang -t
arget-feature -Xclang -idivl-to-divb -Xclang -target-feature -Xclang +idivq-to-divl -Xclang -target-feature -Xclang -invpcid -Xclang -target-feature -Xclang -kl -Xclang -target-feature -Xclang -lea-sp -Xclang -targ
et-feature -Xclang -lea-uses-ag -Xclang -target-feature -Xclang -lvi-cfi -Xclang -target-feature -Xclang -lvi-load-hardening -Xclang -target-feature -Xclang -lwp -Xclang -target-feature -Xclang -lzcnt -Xclang -targ
et-feature -Xclang +macrofusion -Xclang -target-feature -Xclang +mmx -Xclang -target-feature -Xclang -movbe -Xclang -target-feature -Xclang -movdir64b -Xclang -target-feature -Xclang -movdiri -Xclang -target-featur
e -Xclang -mwaitx -Xclang -target-feature -Xclang +nopl -Xclang -target-feature -Xclang -pad-short-functions -Xclang -target-feature -Xclang -pclmul -Xclang -target-feature -Xclang -pconfig -Xclang -target-feature 
-Xclang -pku -Xclang -target-feature -Xclang -popcnt -Xclang -target-feature -Xclang -prefer-128-bit -Xclang -target-feature -Xclang -prefer-256-bit -Xclang -target-feature -Xclang -prefer-mask-registers -Xclang -t
arget-feature -Xclang -prefetchwt1 -Xclang -target-feature -Xclang -prfchw -Xclang -target-feature -Xclang -ptwrite -Xclang -target-feature -Xclang -rdpid -Xclang -target-feature -Xclang -rdpru -Xclang -target-feat
ure -Xclang -rdrnd -Xclang -target-feature -Xclang -rdseed -Xclang -target-feature -Xclang -retpoline -Xclang -target-feature -Xclang -retpoline-external-thunk -Xclang -target-feature -Xclang -retpoline-indirect-br
anches -Xclang -target-feature -Xclang -retpoline-indirect-calls -Xclang -target-feature -Xclang -rtm -Xclang -target-feature -Xclang -sahf -Xclang -target-feature -Xclang -sbb-dep-breaking -Xclang -target-feature 
-Xclang -serialize -Xclang -target-feature -Xclang -seses -Xclang -target-feature -Xclang -sgx -Xclang -target-feature -Xclang -sha -Xclang -target-feature -Xclang -shstk -Xclang -target-feature -Xclang +slow-3ops-
lea -Xclang -target-feature -Xclang +slow-incdec -Xclang -target-feature -Xclang -slow-lea -Xclang -target-feature -Xclang -slow-pmaddwd -Xclang -target-feature -Xclang -slow-pmulld -Xclang -target-feature -Xclang 
-slow-shld -Xclang -target-feature -Xclang -slow-two-mem-ops -Xclang -target-feature -Xclang -slow-unaligned-mem-16 -Xclang -target-feature -Xclang -slow-unaligned-mem-32 -Xclang -target-feature -Xclang -soft-float
 -Xclang -target-feature -Xclang +sse -Xclang -target-feature -Xclang +sse2 -Xclang -target-feature -Xclang -sse3 -Xclang -target-feature -Xclang -sse4.1 -Xclang -target-feature -Xclang -sse4.2 -Xclang -target-feat
ure -Xclang -sse4a -Xclang -target-feature -Xclang -sse-unaligned-mem -Xclang -target-feature -Xclang -ssse3 -Xclang -target-feature -Xclang -tagged-globals -Xclang -target-feature -Xclang -tbm -Xclang -target-feat
ure -Xclang -tsxldtrk -Xclang -target-feature -Xclang -uintr -Xclang -target-feature -Xclang -use-glm-div-sqrt-costs -Xclang -target-feature -Xclang -use-slm-arith-costs -Xclang -target-feature -Xclang -vaes -Xclan
g -target-feature -Xclang -vpclmulqdq -Xclang -target-feature -Xclang +vzeroupper -Xclang -target-feature -Xclang -waitpkg -Xclang -target-feature -Xclang -wbnoinvd -Xclang -target-feature -Xclang -widekl -Xclang -
target-feature -Xclang +x87 -Xclang -target-feature -Xclang -xop -Xclang -target-feature -Xclang -xsave -Xclang -target-feature -Xclang -xsavec -Xclang -target-feature -Xclang -xsaveopt -Xclang -target-feature -Xcl
ang -xsaves -Wno-pragma-pack -mred-zone -fomit-frame-pointer -fno-stack-protector -DNDEBUG -O2 -funwind-tables -gcodeview -MD -MV -MF C:\Users\felix\AppData\Local\zig\tmp\dfff3e6a2243a970-wasmer_main.obj.d -I C:\Us
ers\felix\AppData\Local\Temp\.tmpnAprtL\include -I C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\include -c -o C:\Users\felix\AppData\Local\zig\tmp\dfff3e6a2243a970-wasmer_main.obj                       
lld-link -ERRORLIMIT:0 -NOLOGO -DEBUG -STACK:16777216 -MACHINE:X64 -INCLUDE:_tls_index -OUT:C:\Users\felix\AppData\Local\Temp\.tmpnAprtL\wasmer_main.exe -IMPLIB:C:\Users\felix\AppData\Local\Temp\.tmpnAprtL\wasmer_m
ain.lib C:\Users\felix\AppData\Local\Temp\.tmpnAprtL\atoms\python.o C:\Users\felix\AppData\Local\Temp\.tmpnAprtL\volumes\volume.o C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\lib\libwasmer.a C:\Users\fe
lix\wasmer\package\cache\wasmer-windows-gnu64\winsdk\ADVAPI32.lib C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\winsdk\BCRYPT.lib C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\winsdk\KERNEL32.
lib C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\winsdk\USERENV.lib C:\Users\felix\wasmer\package\cache\wasmer-windows-gnu64\winsdk\WS2_32.lib C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e3610
18b5fe54\wasmer_main.obj -lldmingw -ALTERNATENAME:__image_base__=__ImageBase C:\Users\felix\AppData\Local\zig\o\48af5ddab4e8f997dfa4c14ea5005f82\crt2.obj C:\Users\felix\AppData\Local\zig\o\0445965f49d5fd2da2727960e
32d1404\mingw32.lib C:\Users\felix\AppData\Local\zig\o\a16c0e115e5585a30924c2a45c58da05\mingwex.lib C:\Users\felix\AppData\Local\zig\o\04affbc1f98d63d3d2fe0f0213885f2d\msvcrt-os.lib C:\Users\felix\AppData\Local\zig
\o\87704c2a3ef1dfd645a38c6de082b066\advapi32.lib C:\Users\felix\AppData\Local\zig\o\6ea6398988874157b543ec6c0e760526\kernel32.lib C:\Users\felix\AppData\Local\zig\o\8869aaaa26f9fd370718fc79c7c92455\msvcrt.lib C:\Us
ers\felix\AppData\Local\zig\o\e0ca1e17029bc7872ac3d7daefc7095f\ntdll.lib C:\Users\felix\AppData\Local\zig\o\3c86093ac61037d31eaf8b0439a7a5b7\shell32.lib C:\Users\felix\AppData\Local\zig\o\d420b3033236ebc77d00e7d4dc
aa6457\user32.lib                                                                                                                                                                                                     
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_module_deserialize (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.13
.rcgu.o)) [LNK4217]                                                                                                                                                                                                   
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_config_new (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.13.rcgu.o)
) [LNK4217]                                                                                                                                                                                                           
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_engine_new_with_config (defined in libwasmer.a(wasmer.wasmer.427e55a0-cg
u.13.rcgu.o)) [LNK4217]                                                                                                                                                                                               
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_store_new (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.13.rcgu.o))
 [LNK4217]                                                                                                                                                                                                            
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_instance_new (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.14.rcgu.
o)) [LNK4217]                                                                                                                                                                                                         
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_instance_exports (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.14.r
cgu.o)) [LNK4217]                                                                                                                                                                                                     
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_extern_as_memory (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.8.rc
gu.o)) [LNK4217]                                                                                                                                                                                                      
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_func_call (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.10.rcgu.o))
 [LNK4217]                                                                                                                                                                                                            
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_trap_message (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.8.rcgu.o
)) [LNK4217]                                                                                                                                                                                                          
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_trap_delete (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.8.rcgu.o)
) [LNK4217]                                                                                                                                                                                                           
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_extern_vec_delete (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.8.r
cgu.o)) [LNK4217]                                                                                                                                                                                                     
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_instance_delete (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.14.rc
gu.o)) [LNK4217]                                                                                                                                                                                                      
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_module_delete (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.13.rcgu
.o)) [LNK4217]                                                                                                                                                                                                        
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_store_delete (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.13.rcgu.
o)) [LNK4217]                                                                                                                                                                                                         
lld-link: warning: C:\Users\felix\AppData\Local\zig\o\8ba359527eaab204f49e361018b5fe54\wasmer_main.obj: locally defined symbol imported: wasm_engine_delete (defined in libwasmer.a(wasmer.wasmer.427e55a0-cgu.13.rcgu
.o)) [LNK4217]                                                                                                                                                                                                        
lld-link: error: undefined symbol: _Unwind_Resume                                                                                                                                                                     
>>> referenced by libwasmer.a(wasmer.wasmer.427e55a0-cgu.9.rcgu.o):(_$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::fold::h1c21c71bff7c2815)                  
>>> referenced by libwasmer.a(wasmer.wasmer.427e55a0-cgu.9.rcgu.o):(_$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::fold::h4c08e499252a78ba)                  
>>> referenced by libwasmer.a(wasmer.wasmer.427e55a0-cgu.9.rcgu.o):(_$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::fold::h6f15da45ac2d474f)                  
>>> referenced 6485 more times                                                                                                                                                                                        

lld-link: error: undefined symbol: _Unwind_GetTextRelBase                                                                                                                                                             
>>> referenced by library\panic_unwind\src/gcc.rs:311                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h120afaf66be0f181)                            
>>> referenced by library\panic_unwind\src/gcc.rs:311                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::find_eh_action::_$u7b$$u7b$closure$u7d$$u7d$::h5cbee68fbb2e54a5)                             

lld-link: error: undefined symbol: _Unwind_GetDataRelBase                                                                                                                                                             
>>> referenced by library\panic_unwind\src/gcc.rs:312                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h46860d7ddd1c529e)                            
>>> referenced by library\panic_unwind\src/gcc.rs:312                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::find_eh_action::_$u7b$$u7b$closure$u7d$$u7d$::h9dfe4c779f0c2792)                             

lld-link: error: undefined symbol: _Unwind_DeleteException                                                                                                                                                            
>>> referenced by library\panic_unwind\src/gcc.rs:78                                                                                                                                                                  
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(__rust_panic_cleanup)                                                                                                

lld-link: error: undefined symbol: _Unwind_RaiseException                                                                                                                                                             
>>> referenced by library\panic_unwind\src/gcc.rs:62                                                                                                                                                                  
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(__rust_start_panic)                                                                                                  

lld-link: error: undefined symbol: _Unwind_GetLanguageSpecificData                                                                                                                                                    
>>> referenced by library\panic_unwind\src/gcc.rs:303                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::rust_eh_personality_impl::hb352fbd3e44c33d1)                                                 

lld-link: error: undefined symbol: _Unwind_GetIPInfo                                                                                                                                                                  
>>> referenced by library\panic_unwind\src/gcc.rs:305                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::rust_eh_personality_impl::hb352fbd3e44c33d1)                                                 

lld-link: error: undefined symbol: _Unwind_GetRegionStart                                                                                                                                                             
>>> referenced by library\panic_unwind\src/gcc.rs:310                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::rust_eh_personality_impl::hb352fbd3e44c33d1)                                                 

lld-link: error: undefined symbol: _Unwind_SetGR                                                                                                                                                                      
>>> referenced by library\panic_unwind\src/gcc.rs:254                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::rust_eh_personality_impl::hb352fbd3e44c33d1)                                                 
>>> referenced by library\panic_unwind\src/gcc.rs:256                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::rust_eh_personality_impl::hb352fbd3e44c33d1)                                                 

lld-link: error: undefined symbol: _Unwind_SetIP                                                                                                                                                                      
>>> referenced by library\panic_unwind\src/gcc.rs:257                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(panic_unwind::real_imp::rust_eh_personality_impl::hb352fbd3e44c33d1)                                                 

lld-link: error: undefined symbol: _GCC_specific_handler                                                                                                                                                              
>>> referenced by library\panic_unwind\src/gcc.rs:276                                                                                                                                                                 
>>>               libwasmer.a(panic_unwind-abcb1ca87a57a92a.panic_unwind.6f51e6e7-cgu.0.rcgu.o):(rust_eh_personality)                                                                                                 
error: could not copy from C:\Users\felix\AppData\Local\Temp\.tmpnAprtL\wasmer_main.exe to C:\Users\felix\AppData\Local\Temp\.tmp7g3Pvd\x86_64-windows-gnu-python: The system cannot find the file specified. (os erro
r 2)                                                                                                                                                                                                                                                                                                                                                                                                                                   

This is because zig cannot build libunwind / libcxxabi on Windows when adding -lunwind to zig build-exe:

error(compilation): clang failed with stderr: zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
In file included from C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/cxa_aux_runtime.cpp:14:
In file included from C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxx\include/typeinfo:76:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include/vcruntime_typeinfo.h:121:13: error: target of using declaration conflicts with declaration already in scope
C:\Program Files (x86)\Microsoft Visual Studio\[2019](https://github.com/wasmerio/wasmer/actions/runs/3824129197/jobs/6506132267#step:12:2020)\Enterprise\VC\Tools\MSVC\14.29.30133\include/vcruntime_typeinfo.h:69:7: note: target of using declaration
C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\include/cxxabi.h:30:27: note: conflicting declaration

error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/stdlib_typeinfo.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/stdlib_new_delete.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/stdlib_exception.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/stdlib_stdexcept.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/cxa_handlers.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/cxa_guard.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/cxa_exception.cpp:1:1: unable to build C object: clang exited with code 1
error(compilation): C:\hostedtoolcache\windows\zig\zig-windows-x86_64-0.10.0\x64\lib\libcxxabi\src/cxa_aux_runtime.cpp:1:1: unable to build C object: clang exited with code 1
error: unable to build libunwind: BuildingLibCObjectFailed
error: unable to build libcxxabi: BuildingLibCObjectFailed

We could work around this if we build windows-gnu/libwasmer.a without any panicking / unwinding support, in order to do this, you'd have to use:

RUSTFLAGS=-Cpanic=abort 
cargo +nightly build --release 
-Zbuild-std=std,panic_abort  
-Zbuild-std-features=panic_immediate_abort 
--target x86_64-pc-windows-gnu 
--manifest-path lib/c-api/Cargo.toml 
--no-default-features 
--features wat,compiler,wasi,middlewares,webc_runner 
--features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load

... and then specify it with:

./target/release/wasmer create-exe ./lib/c-api/examples/assets/qjs.wasm 
-o ./js.exe 
--target x86_64-windows-gnu 
--use-wasmer-release https://github.com/wasmerio/wasmer/files/10337786/wasmer-gnu64-2.tar.gz
ptitSeb commented 1 year ago

Need to create a ticket on zig repo about this issue.

ptitSeb commented 1 year ago

Need to test if it's working with CLANG instead of Zig (this info will be needed for the Zig ticket probably)

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 months ago

Feel free to reopen the issue if it has been closed by mistake.