Stream: git-wasmtime

Topic: wasmtime / issue #10744 MSVC static linking issues since v29


view this post on Zulip Wasmtime GitHub notifications bot (May 07 2025 at 15:21):

Photosounder opened issue #10744:

I just now updated my installation of Wasmtime from wasmtime-v25.0.1-x86_64-windows-c-api and I have linking problems starting from v29.0.0. Up to 28.0.1 my project that statically links to wasmtime.lib without a warning, but starting with v29.0.0 and up to v32 I get these new warnings and errors:

1>Finished searching libraries
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Searching libraries
1>Finished searching libraries
1>LINK : warning LNK4217: symbol 'calloc' defined in 'libucrtd.lib(calloc.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_createCCtxParams'
1>LINK : warning LNK4286: symbol 'calloc' defined in 'libucrtd.lib(calloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)'
1>LINK : warning LNK4217: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_clearAllDicts'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-jitprofiling.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_ddict.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)'
1>LINK : warning LNK4217: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_CCtx_loadDictionary'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-jitprofiling.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_ddict.o)'
1>LINK : warning LNK4217: symbol 'strncpy_s' defined in 'libucrtd.lib(strncpy_s.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)' in function '__itt_domain_createA_init_3_0'
1>LINK : warning LNK4217: symbol 'strnlen' defined in 'libucrtd.lib(strnlen.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)' in function '__itt_domain_createA_init_3_0'
1>wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o) : error LNK2019: unresolved external symbol __imp__wcsdup referenced in function __itt_domain_createW_init_3_0
1>C:\msys\home\wahe\WAHE host lite\x64\Debug\wahe_host_lite.exe : fatal error LNK1120: 1 unresolved externals

It seems like it could be from the library being linked differently than before to a standard library, but I can't really tell what's wrong and everything I tried so far only created more problems or failed to resolve these. Looking at the January 2025 commits I can't see commits that would explain what changed either.

view this post on Zulip Wasmtime GitHub notifications bot (May 07 2025 at 15:21):

Photosounder added the bug label to Issue #10744.

view this post on Zulip Wasmtime GitHub notifications bot (May 07 2025 at 15:29):

alexcrichton commented on issue #10744:

This might perhaps be related to https://github.com/bytecodealliance/wasmtime/pull/9891 which could affect how ittapi-sys, the crate that I believe is including ittnotify_static.o, could be compiled?

That being said I fear that most of us aren't windows-experts-enough to figure this one out easily. For example I don't know much about the warnings or how to resolve the error, I don't know where _wcsdup is supposed to come from.

If it works for you then you might be able to get things working compiling from source yourself. You can probably disable the profiling feature unless you need vtune support (which is what ittnotify is used for). Unless you need caching you can disable that too and remove the zstd warnings.

cc @abrown as the unresolved symbol is in ittapi

view this post on Zulip Wasmtime GitHub notifications bot (May 07 2025 at 18:02):

abrown commented on issue #10744:

Looks like it may be coming from bindgen since that is the containing function. Agreed that compiling from source is a good temporary workaround until we figure out what is going on.

view this post on Zulip Wasmtime GitHub notifications bot (May 07 2025 at 19:27):

Photosounder edited issue #10744:

I just now updated my installation of Wasmtime from wasmtime-v25.0.1-x86_64-windows-c-api and I have linking problems starting from v29.0.0. Up to 28.0.1 my project that statically links to wasmtime.lib compiles without a warning, but starting with v29.0.0 and up to v32 I get these new warnings and errors:

1>Finished searching libraries
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Searching libraries
1>Finished searching libraries
1>LINK : warning LNK4217: symbol 'calloc' defined in 'libucrtd.lib(calloc.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_createCCtxParams'
1>LINK : warning LNK4286: symbol 'calloc' defined in 'libucrtd.lib(calloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)'
1>LINK : warning LNK4217: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_clearAllDicts'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-jitprofiling.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_ddict.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)'
1>LINK : warning LNK4217: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(1ddd1489cc625d97-zstd_compress.o)' in function 'ZSTD_CCtx_loadDictionary'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-jitprofiling.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_decompress.o)'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'wasmtime.lib(690f776bf7b37aeb-zstd_ddict.o)'
1>LINK : warning LNK4217: symbol 'strncpy_s' defined in 'libucrtd.lib(strncpy_s.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)' in function '__itt_domain_createA_init_3_0'
1>LINK : warning LNK4217: symbol 'strnlen' defined in 'libucrtd.lib(strnlen.obj)' is imported by 'wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o)' in function '__itt_domain_createA_init_3_0'
1>wasmtime.lib(cb7057cb9c9a66a6-ittnotify_static.o) : error LNK2019: unresolved external symbol __imp__wcsdup referenced in function __itt_domain_createW_init_3_0
1>C:\msys\home\wahe\WAHE host lite\x64\Debug\wahe_host_lite.exe : fatal error LNK1120: 1 unresolved externals

It seems like it could be from the library being linked differently than before to a standard library, but I can't really tell what's wrong and everything I tried so far only created more problems or failed to resolve these. Looking at the January 2025 commits I can't see commits that would explain what changed either.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2025 at 20:04):

abrown commented on issue #10744:

@Photosounder, I talked to someone on the ITTAPI team and we want to check if this has to do with a difference in the MSVCRT version between your system and where those libraries were compiled. Wasmtime v29 was released in January and perhaps some update in the GitHub runners that compiled the project is causing an incompatibility (maybe in combination with #9891?). I'm no expert on the Windows side of things, but apparently you can query the version of msvcrt.dll using: wmic datafile where name="C:\\Windows\\System32\\msvcrt.dll" get Version. That could be helpful.

What would really help here is a minimal reproducer. Are you able to create some code somewhere that others can run to replicate the issue? Ideally it would not require all the code of your project that is using Wasmtime, but rather just an example C/C++ file of some kind and the linker steps that cause the problem. Can you do that?

view this post on Zulip Wasmtime GitHub notifications bot (May 14 2025 at 10:06):

Photosounder commented on issue #10744:

No problem, here it is: https://www.mediafire.com/file/x7exrzr13mmodox/WAHE+host+lite+selfcontained.zip/file

You just have to rename one of the wasmtime folders to wasmtime, then double-click wahe_host_lite.vcxproj and build. The v28 version should work fine except for one warning about LIBCMT only in the Debug build (I don't know why), and the v29 should give you what I pasted in the original post.

wmic datafile where name="C:\\Windows\\System32\\msvcrt.dll" get Version gives me 7.0.19041.3636.


Last updated: Dec 06 2025 at 06:05 UTC