Skip to content

Support /alternatename directive - #114

Merged
dra27 merged 2 commits into
ocaml:masterfrom
jonahbeckford:feature-alternatename
Mar 5, 2023
Merged

dra27 merged 2 commits into
ocaml:masterfrom
jonahbeckford:feature-alternatename

Conversation

@jonahbeckford

@jonahbeckford jonahbeckford commented Feb 27, 2023 •

Copy link
Copy Markdown
Contributor

Fix for issue #113. Full description there.

Testing

With 32-bit MSVC:

Z:\source\flexdll\flexlink.exe -v -v -o src\ActorSystem\system.exe -U /out:src\ActorSystem\system.exe -implib -L "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x86" -L "C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" -L "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" -L "C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86" -L "Z:\source\DkHelloWorldActor\build_community\DkSDKFiles\o\s\o\lib\ocaml" src\ActorSystem\DkHelloWorldActor_system.lib advapi32.lib ws2_32.lib version.lib -exe -no-merge-manifest -custom-crt msvcrt.lib -chain msvc -stack 16777216 -L Z:\source\DkHelloWorldActor\build_community\DkSDKFiles\o\s\o\lib\ocaml src\ActorSystem\DkHelloWorldActor_system.lib advapi32.lib ws2_32.lib version.lib libasmrund.lib src\ActorSystem\CMakeFiles\system.dir\_main.c.obj -- /nologo /pdb:src\ActorSystem\system.pdb /version:0.0 /ENTRY:wmainCRTStartup /machine:X86 /debug /INCREMENTAL /subsystem:console /MANIFEST /MANIFESTFILE:src\ActorSystem\CMakeFiles\system.dir/intermediate.manifest src\ActorSystem\CMakeFiles\system.dir/manifest.res

verbose logs are:

** open: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x86\MSVCRTD.lib
alternatename __filter_x86_sse2_floating_point_exception -> __filter_x86_sse2_floating_point_exception_default
alias ??_Etype_info@@UAEPAXI@Z -> ??_Gtype_info@@UAEPAXI@Z
alias ??_Ebad_array_new_length@std@@UAEPAXI@Z -> ??_Gbad_array_new_length@std@@UAEPAXI@Z
alias ??_Ebad_alloc@std@@UAEPAXI@Z -> ??_Gbad_alloc@std@@UAEPAXI@Z
alias ??_Eexception@std@@UAEPAXI@Z -> ??_Gexception@std@@UAEPAXI@Z
alternatename __pRawDllMain -> __pDefaultRawDllMain
alternatename ___acrt_initialize -> ___scrt_stub_for_acrt_initialize
alternatename ___acrt_uninitialize -> ___scrt_stub_for_acrt_uninitialize
alternatename ___acrt_uninitialize_critical -> ___scrt_stub_for_acrt_uninitialize_critical
alternatename ___acrt_thread_attach -> ___scrt_stub_for_acrt_thread_attach
alternatename ___acrt_thread_detach -> ___scrt_stub_for_acrt_thread_detach
alternatename __is_c_termination_complete -> ___scrt_stub_for_is_c_termination_complete
alternatename ___vcrt_initialize -> ___scrt_stub_for_acrt_initialize
alternatename ___vcrt_uninitialize -> ___scrt_stub_for_acrt_uninitialize
alternatename ___vcrt_uninitialize_critical -> ___scrt_stub_for_acrt_uninitialize_critical
alternatename ___vcrt_thread_attach -> ___scrt_stub_for_acrt_thread_attach
alternatename ___vcrt_thread_detach -> ___scrt_stub_for_acrt_thread_detach

and the following bug error disappears:

** Cannot resolve symbols for C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x86\msvcrt.lib(d:\agent\_work\2\s\Intermediate\vctools\msvcrt.nativeproj_110336922\objr\x86\chandler4gs.obj):
 __filter_x86_sse2_floating_point_exception

@dra27

dra27 commented Feb 27, 2023

Copy link
Copy Markdown
Member

Thanks for this! The CI script is accidentally using 32-bit Cygwin, but hopefully if that gets tweaked, we can get some useful results from CI too

@dra27 dra27 closed this Mar 2, 2023
@dra27 dra27 reopened this Mar 2, 2023
@dra27

dra27 commented Mar 2, 2023

Copy link
Copy Markdown
Member

(closed and re-opened to recompute the merge commit now that #115 is merged, so CI should have something useful to say!)

@dra27 dra27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks (very) good to me, thanks - just a renaming of the parameter if that's OK, please?

Comment thread reloc.ml Outdated
Collect such cases in "imported".
*)
let needed imported defined unalias obj =
let needed imported defined unalias unalternate obj =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently unalternate is a word, though not according to my browser's spell checker! I think resolve_alternate (and possibly therefore renaming unalias to resolve_alias but at least unalias does mean to resolve the alias!) 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

@dra27
dra27 merged commit 47fbd31 into ocaml:master Mar 5, 2023
@dra27

dra27 commented Mar 5, 2023

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for /alternatename: linker directive needed for x86

2 participants