[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with MariaDB 10.5 cross-building?



Hi Otto and Daniel,

please avoid mailing me on cross compilation questions directly.
Instead, please mail debian-cross@lists.debian.org. This reaches a wider
audience and increases your chances for a timely response. Thanks.

On Fri, Feb 17, 2023 at 03:14:18PM +0700, Daniel Black wrote:
> As uca-dump is a build helper it appears to have been built.
> 
> The dependencies in strings/CMakeLists.txt make it look like uca-dump
> is a build dep of GenUnicodeDataSource via the ADD_CUSTOM_COMMAND
> dependency.
> 
> It's on reporting  "not found" error rather than a "executate format
> error" where I'd normally suggest the cross compilation appears to be
> built without CMAKE_CROSS_COMPILING_EMULATOR
> set.

This explanation is spot-on, but it doesn't quite tell how to fix it
yet.

We can see that mariadb already has a native build pass and exports
tools to be used in the cross build. I suppose, uca-dump was added
rather recently and was missed here. The big question though is whether
uca-dump actually behaves the same on all architectures. Would it be
possible for you to run it on various systems and compare the resulting
header? Usually the important comparisons are big endian vs little
endian and 32bit vs 64bit, which amounts to 3 builds if done right.
Another approach is dumping the resulting header to the build log and
uploading a thus modified package to experimental. Then one can scrape
the header from the build logs.

If one assumes that uca-dump behaves the same on different
architectures, then fixing this issue is a relatively simple matter of
adding it to exported executables. I'm attaching a patch for your
convenience. Please only apply it after verifying that its output is
indeed architecture-independent.

Helmut
--- mariadb-10.11.2.orig/CMakeLists.txt
+++ mariadb-10.11.2/CMakeLists.txt
@@ -483,7 +483,7 @@
 ADD_SUBDIRECTORY(extra/aws_sdk)
 
 IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
-  SET(EXPORTED comp_err comp_sql factorial)
+  SET(EXPORTED comp_err comp_sql factorial uca-dump)
   IF(NOT WITHOUT_SERVER)
     SET(EXPORTED ${EXPORTED} gen_lex_hash gen_lex_token)
   ENDIF()
--- mariadb-10.11.2.orig/strings/CMakeLists.txt
+++ mariadb-10.11.2/strings/CMakeLists.txt
@@ -41,7 +41,9 @@
 SET_TARGET_PROPERTIES(conf_to_src PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
 TARGET_LINK_LIBRARIES(conf_to_src mysys strings)
 
-ADD_EXECUTABLE(uca-dump uca-dump.c)
+IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
+  ADD_EXECUTABLE(uca-dump uca-dump.c)
+ENDIF()
 
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ctype-uca1400data.h

Reply to: