Getting the symbol size for a 1 byte global might return a value of 0 on Windows (and possibly other targets).
Describe the Bug I was working on getting the tests to pass on Windows so that I could test my own features, but a couple tests that should have passed did not pass.
https://github.com/TheDan64/inkwell/blob/075db5c0f535c500f9e801313e570206ab28f613/tests/all/test_object_file.rs#L98
This test will fail on my machine because the size reported is 0 rather than 1. This doesn't seem to be an inkwell error, but rather a Windows specific behavior (it may also happen on other platforms, but I only have a Windows machine).
To Reproduce Must have a windows machine.
Expected Behavior
The expected behavior is for symbol.size() to return 1 for the i8 global.
LLVM Version (please complete the following information):
- LLVM Version: 11.0.1
- Inkwell Branch Used: llvm11-0
- Target: target-x86
Desktop (please complete the following information):
- OS: Windows 11 64-bit
Also, I want to mention that there's also that bug that I mentioned before in test_targets.rs here where the code doesn't compile on Windows. I also fixed that issue. I provided what I believe to be the correct vendors for Windows, as well as the windows os in the os array. I also made it so that os will be [&str; 0] if not on Linux, MacOS, or Windows.
Unfortunately we've never had CI tests running on Windows to keep it up to date. Would be a great addition to the test suitee
In my work on the OrcEngine, I'll include some changes to the tests. My version is able to build and pass on Windows.
My original plan was to implement both Orc V1 and V2 in one PR, but it's been taking a little longer than I expected to finish V1, so I'm going to do them separately. I hope you don't mind waiting a while before publishing v0.7.0.