[MDEV-32149] cross-compiling on Windows x64 for arm64 failed Created: 2023-09-11 Updated: 2023-09-24 Resolved: 2023-09-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling |
| Affects Version/s: | 11.3 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Luan Castro | Assignee: | Vladislav Vaintroub |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
OS: Windows 10 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Repro steps:
|
| Comments |
| Comment by Daniel Black [ 2023-09-12 ] | |||||||||||||
|
Hi, As we don't have cross compiled builds in CI we don't officially support it. That said, looking at a cross compulation in debian - http://crossqa.debian.net/build/mariadb_1:10.11.4-1_s390x_20230911041536.log - it appears that a native build of the executables in import_executables needs to happen before the attempt at cross compulation. Mapping what Debian does it might require:
Also to get ARM cross compile working in mysys/CMakeLists.txt an:
to build with mysys/crc32/crc32_arm64.c, and that file might need a constant implementation of
Patches and edits to https://mariadb.com/kb/en/Building_MariaDB_on_Windows/ most welcome. | |||||||||||||
| Comment by Vladislav Vaintroub [ 2023-09-13 ] | |||||||||||||
|
I got this cross-compilation working couple of years ago, though never actually had the hardware to test the result. Anyway, it is simple to fix, you just provide additional parameter -DCMAKE_SYSTEM_NAME=Windows , as they suggest in CMAKE_CROSSCOMPILING docs That works for me
and spits out mariadb-11.3.0-winarm64.zip As I said, it was never tested here, so there is a good chance it would not work. It does not have an optimized crc32, I think that needs to be implemented once we get a chance to test it. | |||||||||||||
| Comment by Daniel Black [ 2023-09-18 ] | |||||||||||||
|
v-luanca, how did you go? Did you get it going? Is there something we can prepare into a documentation outcome for this? | |||||||||||||
| Comment by Vladislav Vaintroub [ 2023-09-24 ] | |||||||||||||
|
I verified that the below works OK, providing native bison is there. From the source directory.
If one builds with Release config, it would be necessary to replace RelWithDebInfo with Release above, in both cases where it is used , i.e for both the native and and the cross build | |||||||||||||
| Comment by Vladislav Vaintroub [ 2023-09-24 ] | |||||||||||||
|
So, summary : it works fine , but "repro steps" do not set CMAKE_SYSTEM_NAME which is necessary in the recent versions of CMake to recognize cross-compilation (even if CMAKE_SYSTEM_NAME does not change, it needs to be set). | |||||||||||||
| Comment by Vladislav Vaintroub [ 2023-09-24 ] | |||||||||||||
|
In fact, |