-
Notifications
You must be signed in to change notification settings - Fork 616
Fix Windows CI linking failures. #4373
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
Closed
Closed
+11
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: hanhanW <[email protected]>
Contributor
Author
|
Try windows build in https://github.com/llvm/torch-mlir/actions/runs/19287555075 |
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
f4d4cf8 to
f6a6cf1
Compare
Signed-off-by: hanhanW <[email protected]>
f6a6cf1 to
2b0f871
Compare
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
The previous approach of creating a dummy .c file for DllMain failed because CMake's Ninja generator corrupts file paths on Windows (e.g., 'tools' becomes 'ools'). This path corruption affects both object library paths and regular source file paths. Instead of fighting CMake's path mangling, we use /NOENTRY to tell the linker we don't need a traditional DLL entry point. The static libraries linked with /WHOLEARCHIVE will provide any necessary initialization code. This eliminates the need for any source files, avoiding the path corruption issue entirely.
The /NOENTRY approach failed because: 1. It prevents linking of necessary runtime libraries 2. WINDOWS_EXPORT_ALL_SYMBOLS requires at least one source file 3. This caused unresolved MLIR C API symbols (mlirOperationCreate, etc.) New approach uses a minimal assembly file (stub.asm) that: - Provides a source file to satisfy CMake/linker requirements - Generates almost no code (just a minimal .CODE segment) - Avoids path corruption issues that affect .c/.cpp files - Allows WINDOWS_EXPORT_ALL_SYMBOLS to work properly - Lets /WHOLEARCHIVE libraries provide all actual symbols
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
f039a8e to
8d01509
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.