Skip to content

Conversation

@hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Nov 12, 2025

No description provided.

@hanhanW
Copy link
Contributor Author

hanhanW commented Nov 12, 2025

Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
@hanhanW hanhanW force-pushed the users/hanhanW/try-to-fix-windows-build branch from f4d4cf8 to f6a6cf1 Compare November 12, 2025 19:33
Signed-off-by: hanhanW <[email protected]>
@hanhanW hanhanW force-pushed the users/hanhanW/try-to-fix-windows-build branch from f6a6cf1 to 2b0f871 Compare November 12, 2025 19:43
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]>
@hanhanW hanhanW force-pushed the users/hanhanW/try-to-fix-windows-build branch from f039a8e to 8d01509 Compare November 13, 2025 03:38
@hanhanW hanhanW closed this Nov 13, 2025
@hanhanW hanhanW deleted the users/hanhanW/try-to-fix-windows-build branch November 13, 2025 22:25
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