-
Notifications
You must be signed in to change not 8000 ification settings - Fork 36
Cross complilation of bundle libevent for windows uses wrong compiler #114
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
Comments
I checked if the existing bundle/libevent/CMakeLists.txt contributes to the problem by removing it, but that does not help. Still the build produces host files, not cross files. And without it, I can no longer cross compile the bundled libevent for RTEMS. |
So far with What "support" means in the context of cross building with cmake is a toolchain file referenced by Lines 58 to 61 in e32a752
The mingw version is: pvxs/bundle/cmake/x86_64-w64-mingw32.cmake Lines 1 to 9 in e32a752
So one simple way to start would be to copy this file (toolchain file names are not important) and set |
Long term, that is not maintainable. I do not think that it is a good idea to mix cmake into the EPICS build system. Consder using the EPICS build system for the bundle too, so that one does not need to have "special cases" for everything. |
I agree.
I believe that a plain Makefile build is infeasible. libevent makes extensive use of autoconf style probing (cf. What I think would be feasible is more comprehensive generation of cmake toolchain files. Of perhaps it would be better to give up on the idea of
Thinking about it now, a more appropriate test would be |
Can we assume that all Windows systems can share the same config, as well as all Linux systems, and all Macs? In that case, you could provide pre-built config files per |
I tried it with a toolchain file that I used for another project. Unfortunately it fails when building sha1.c.obj:
Maybe I will try on Windows natively... |
Found the problem. As this is a cross build, cmake did not assume its native byte order. And (as configured) did not bother to run the test for it. That caused a wrong compiler flag |
Can you attached this file? |
Yes, I think these three OSs should have similar toolchain files. RTEMS will be the outlier as this is my doing (see
This looks to me like a logic hole in the Which version of |
This is my file. A colleague made it for me for another project. I do not understand the reasoning for anything in it. I just added the
The |
My cmake version is 3.26.5 |
The "logic hole" is in libevent/CMakeLists.txt lines 988-996. It does not consider cross compilation. |
Bug Description
I am cross compiling on RHEL8 for windows-x64 using the MSVC 2019 compiler in wine.
However, when building the bundled libevent using
make -C pvxs/bundle libevent.windows-x64
, the build uses the host gcc instead of the Microsoft compiler in wine as configured in EPICS base:The produced include files are unusable for the cross build, leading to the following compiler error:
Also, the libraries installed in bundle/usr/windows-x64/lib/ are *.so files, clearly for Linux and not for Windows.
Expected behavior
The bundle build should use the compiler as defined in EPICS base for the cross architecture in use, not the host compiler.
Information (please complete the following):
Additional context
My CONFIG.Linux.windows-x64, included by CONFIG.RHEL8-x86_64.windows-x64:
We have installed MSVC in /opt/wine-msvc-$(MSVC_VERSION) and have wrapper scripts calling wine for the compiler cl, the linker, etc.
The text was updated successfully, but these errors were encountered: