ruby - Visual Studio 2012 produces unresolved externals for xmm -
ruby 1.9.1 fails build visual studio 2012 (update1 , 2) due unresolved externals, when building default -arch:sse compiler flag.
cl -nologo -ld main.obj dmyext.obj msvcr110-ruby191-static.lib msvcr110-ruby191.res unicows.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib -femsvcr110-ruby191.dll -link -incremental:no -debug -opt:ref -opt:icf -implib:dummy.lib -def:msvcr110-ruby191.def -map:map-out.txt creating library dummy.lib , object dummy.exp dummy.exp : error lnk2001: unresolved external symbol _xmm@41f00000000000000000000000000000 dummy.exp : error lnk2001: unresolved external symbol _xmm@7fffffffffffffff7fffffffffffffff msvcr110-ruby191.dll : fatal error lnk1120: 2 unresolved externals opening module definition file, following register data items appear in export section:
__xmm@80000000000000008000000000000000 data __xmm@80000000800000008000000080000000 data _xmm@41f00000000000000000000000000000 data _xmm@7fffffffffffffff7fffffffffffffff data the first 2 items preceded 2 underscores not cause issue, last 2 items preceded 1 underscore responsible unresolved externals. manually modifying def file have 2 underscores seems fix problem, i'm not sure if hiding problem or fixing problem.
another option build linker flag -force:unresolved, dangerous if unresolved externals required.
a third option fix compile -arch:ia32 option, not produce sse instructions. however, ruby dll built x64 platform , there appears no way build x64 using alternative -arch option.
my questions are:
is normal / expected xmm register data appear export in module definition file?
are there ideas on how resolve win32 , x64 platforms?
this issue resolved.
it turns out there ruby script called mkexports.rb generates exports msvcr110-ruby191.lib.
in function each_export, there line of code excludes data items based on 8 - 16 hexadecimal digits, excludes __real data.
next if /(?!^)@.*@/ =~ l || /@[[:xdigit:]]{8,16}$/ =~ l || /^_dllmain@/ =~ l amended code exlude items based on 8 - 32 hexadecimal digits, excludes __xmm data, too.
next if /(?!^)@.*@/ =~ l || /@[[:xdigit:]]{8,32}$/ =~ l || /^_dllmain@/ =~ l
Comments
Post a Comment