-
Notifications
You must be signed in to change notification settings - Fork 161
OpenCL ICD Loader Fixes for mingw #186
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
Conversation
Do not have a "lib" prefix to be consistent with MSVC. Silence warnings for stdcall fixup.
69df1f0 to
32632d7
Compare
|
Awesome work @bashbaug , thanks for cracking this one! Small questions:
|
I actually didn't need to do either of these, since the mingw linker printed a message when it couldn't find the undecorated name: I've since cross-checked this against the exports created by MSVC and the output from the "gendef" tool so I'm fairly certain I got them all and they're correct, but it is still a bit of a manual process. If we wanted to be more sure we could auto-generate a "call every API" test file and include it in CI, but that's getting a little ahead of ourselves since we don't even have this config in CI (yet?).
No, I looked into this but I didn't find any existing projects I could start from or obvious CMake functionality to help out. I'd still like to come back to ths at some point. The very best solution IMHO would be to use more We could also look into a solution similar to Mesa, where a single .def file gets processed by a python script, so at least then we don't need to keep two .def files in sync. That's debatably overkill though, since we shouldn't need to modify our .def files very often. |
|
Thanks for the details @bashbaug . I'll take a shot at generating these files (def + map) using the python/Docs framework once this is merged. It seems the decoration is 4*number of arguments, and if there are exceptions they should be easy to spot with the diff. |
|
I approved, but I think @jenatali should take a look at the |
jenatali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I don't know the CM APIs very well.
|
@bashbaug do you want me to press the merge button, or do you think more discussion is needed? |
|
I think this is ready to go - I've been testing with these changes for some time now and I haven't seen any issues, and the only semi-risky part is the specific .def file, which is mingw specific. |
import library issue should be fixed with KhronosGroup/OpenCL-ICD-Loader#186
import library issue should be fixed with KhronosGroup/OpenCL-ICD-Loader#186
import library issue should be fixed with KhronosGroup/OpenCL-ICD-Loader#186
import library issue should be fixed with KhronosGroup/OpenCL-ICD-Loader#186
import library issue should be fixed with KhronosGroup/OpenCL-ICD-Loader#186
This PR has several fixes that enable building the OpenCL ICD loader and an import library using mingw:
function@n). This is needed to generate a proper import library for 32-bit mingw only. For all other builds we will continue to use the same .def file as before.CM_Get_DevNode_PropertyWtoCM_Get_DevNode_Registry_PropertyW. This performs the same query but using a function that is in mingw headers. Note, this is the similar flow used by the Vulkan loader (link)._WIN32_WINNTto0x0600(Windows Vista) forInitOnceExecuteOnce.OpenCL.dllinstead of alibOpenCL.dll.Note, I did need to disable OpenCLOn12 via
OPENCL_ICD_LOADER_DISABLE_OPENCLON12, so this isn't quite perfect, but it's much better than what we have currently.Fixes #191.
See also: #11? #130?
See also: KhronosGroup/OpenCL-SDK#58