-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the exported symbol name for 32-bit win32 DLL build #2190
Conversation
?Create@SimpleSpanProcessorFactory@trace@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VSpanProcessor@trace@sdk@v1@opentelemetry@@U?$default_delete@VSpanProcessor@trace@sdk@v1@opentelemetry@@@std@@@std@@$$QEAV?$unique_ptr@VSpanExporter@trace@sdk@v1@opentelemetry@@U?$default_delete@VSpanExporter@trace@sdk@v1@opentelemetry@@@std@@@7@@Z | ||
#else | ||
?Create@SimpleSpanProcessorFactory@trace@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VSpanProcessor@trace@sdk@v1@opentelemetry@@U?$default_delete@VSpanProcessor@trace@sdk@v1@opentelemetry@@@std@@@std@@$$QAV?$unique_ptr@VSpanExporter@trace@sdk@v1@opentelemetry@@U?$default_delete@VSpanExporter@trace@sdk@v1@opentelemetry@@@std@@@7@@Z | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything special about this symbol, that the name mangling is different for 32 and 64 bit. Could there be more such scenarios ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some flag is different in the name mangling between win32 and win64. There could be more for OTLP part, which I am building and check the expected symbols there. Thanks for the catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got some reference on the name mangling of MSVC. Check p.30 in below doc. Seems the difference lies in the encoding of pointer type, and on 64-bit platform, the needs to be encoded as E
which represents 64-bit, while on 32-bit this is not needed.
https://www.agner.org/optimize/calling_conventions.pdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
In a different PR, I think we need a link test that calls every exported API.
This test does not need to execute, just to link, to make sure apis are exported properly.
We have win32 x64 build in CI but no win32 x86 build there, probably we should add it. |
Fixes #2167
Changes
Some functions are mangled differently between win32 and win64 which is fixed in the export def file.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes