Make core HRX build helpers Windows-safe#97
Merged
Conversation
cd5e821 to
82107e5
Compare
benvanik
approved these changes
Jun 15, 2026
Keep this branch limited to generic HRX/IREE Windows enablement.
Changes:
- Export HRX public API symbols with `__declspec(dllexport/dllimport)` on Windows while preserving `HRX_STATIC` for static builds.
- Replace the exported `hrx_host_allocator_system_value` data symbol with a `hrx_host_allocator_system()` function. This avoids Windows DLL data import/export pitfalls and removes the GCC-only constructor.
- Update the CTS dynamic loader to resolve `hrx_host_allocator_system` as a function instead of looking up the old allocator data symbol.
- Apply ELF hidden-visibility and `-Wl,--version-script` link flags only on non-Windows platforms, since MSVC/link.exe does not support them.
- Remove the stale MSVC natvis link option because this HRX tree does not ship `runtime/iree.natvis`.
- Render the VM ISA Python generator through CMake's discovered `${Python3_EXECUTABLE}` instead of assuming `python3` is on Windows `PATH`, and cover that converter path with a unit test.
82107e5 to
a16cac9
Compare
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
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.
Submits parts of #37 needed to enable a Windows build.
Changes:
__declspec(dllexport/dllimport)on Windows while preservingHRX_STATICfor static builds.hrx_host_allocator_system_valuedata symbol with ahrx_host_allocator_system()function. This avoids Windows DLL data import/export pitfalls and removes the GCC-only constructor.hrx_host_allocator_systemas a function instead of looking up the old allocator data symbol.-Wl,--version-scriptlink flags only on non-Windows platforms, since MSVC/link.exe does not support them.runtime/iree.natvisdoesn't exist, so reduced/embedded HRX layouts do not reference a missing debugger file.${Python3_EXECUTABLE}in VM bytecode ISA genrules instead of assuming apython3executable is on WindowsPATH.