Skip to content
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

Support windows linking with xrt_coreutil_static without dllimport #8586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stsoe
Copy link
Collaborator

@stsoe stsoe commented Nov 1, 2024

Problem solved by the commit

Add a preprocessor directive to turn off dllimport decoration of exported symbols when exported APIs are intended to be statically linked into some external target.

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

On windows LNK4217 means that a symbol defined in one object (e.g., a static link library) is being imported by another object. In order to avoid this situation, the __declspec(dllimport) modifier should be removed from the object that uses the symbol.

How problem was solved, alternative solutions (if any) and why they were rejected

This PR simply adds XRT_STATIC_BUILD preprocessor directive that can be used when compiling objects that use XRT symbols and link to static libraries from XRT.

Risks (if any) associated the changes in the commit

The changes in this PR are target for xrt_coreutil_static usage only, specifically for use in a user-mode-driver for DirectML.

Add a preprocessor directive to turn off dllimport decoration of
exported symbols when exported APIs are intended to be statically
linked into some external target.

On windows LNK4217 means that a symbol defined in one object (e.g., a
static link library) is being imported by another object.  In order to
avoid this situation, the __declspec(dllimport) modifier should be
removed from the object that uses the symbol.

This PR simply adds XRT_STATIC_BUILD preprocessor directive that can
be used when compiling objects that use XRT symbols and link to static
libraries from XRT.

The changes in this PR are target for xrt_coreutil_static usage only,
specifically for use in a user-mode-driver for DirectML.
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.

2 participants