Closed ab503044120 closed 3 years ago
Perhaps duplicate of #3662 , you can enable LIBC
option as workaround. (For both GCC and MSVC,) there's no straightforward way to disable specific optimization that can insert memset
etc.
IMHO, static library build should not include its own memset
and should defer these to linked executables.
Perhaps duplicate of #3662 , you can enable
LIBC
option as workaround. (For both GCC and MSVC,) there's no straightforward way to disable specific optimization that can insertmemset
etc.IMHO, static library build should not include its own
memset
and should defer these to linked executables.
the error only occur on build release ,debug build can work well
the error only occur on build release ,debug build can work well
Results can be inconsistent between optimization levels because static-linking do not guarantee pulling entire .obj
s in the library and optimization might add/remove function calls.
Re.this particular case, difference comes from MSVCRT(D).LIB.
oku@stripe /cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/lib/x64
$ llvm-nm msvcrt.lib | grep memset
U memset
00000010 D __memset_nt_iters
oku@stripe /cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/lib/x64
$ llvm-nm msvcrtd.lib | grep memset
00000010 D __memset_nt_iters
Only release version of the runtime library uses memset
function and it ultimately pulls that symbol.
the error only occur on build release ,debug build can work well
Results can be inconsistent between optimization levels because static-linking do not guarantee pulling entire
.obj
s in the library and optimization might add/remove function calls.Re.this particular case, difference comes from MSVCRT(D).LIB.
oku@stripe /cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/lib/x64 $ llvm-nm msvcrt.lib | grep memset U memset 00000010 D __memset_nt_iters oku@stripe /cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/lib/x64 $ llvm-nm msvcrtd.lib | grep memset 00000010 D __memset_nt_iters
Only release version of the runtime library uses
memset
function and it ultimately pulls that symbol.
Thanks for your answer
step: