-
Notifications
You must be signed in to change notification settings - Fork 80
Failure on cross-compiling for Windows using mingw #609
Description
Describe the bug
Over at JuliaPackaging/Yggdrasil#9453 I try to cross-compile MEOS for different platforms for the Julia programming language. When cross-compiling for Windows (using mingw), this fails:
[ 43%] Building C object meos/postgres/port/CMakeFiles/port.dir/pg_bitutils.c.obj
cd /workspace/srcdir/MobilityDB/build/meos/postgres/port && /opt/bin/x86_64-w64-mingw32-libgfortran5-cxx11/x86_64-w64-mingw32-gcc --sysroot=/opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/ -DGSL_VERSION_STRING=\"2.7.1\" -DMEOS=1 -DMEOS_IS_BIG_ENDIAN=0 -DMOBILITYDB_VERSION_STRING="\"MobilityDB 1.2.0\"" -DNO_FFSL -DNPOINT=0 -DPOSE=0 -DPOSTGIS_PGSQL_VERSION=140 -DPOSTGIS_VERSION_NUMBER=30500 -DPOSTGIS_VERSION_STRING="\"PostGIS 3.5.0\"" -DPOSTGRESQL_VERSION_NUMBER=140200 -DPOSTGRESQL_VERSION_STRING="\"PostgreSQL 14.2\"" -DSYSTEMTZDIR=\"/usr/share/zoneinfo\" -D_USE_MATH_DEFINES @CMakeFiles/port.dir/includes_C.rsp -O3 -DNDEBUG -O2 -fvisibility=hidden -Wall -Wextra -std=gnu1x -Wunused-parameter -Wno-strict-aliasing -MD -MT meos/postgres/port/CMakeFiles/port.dir/pg_bitutils.c.obj -MF CMakeFiles/port.dir/pg_bitutils.c.obj.d -o CMakeFiles/port.dir/pg_bitutils.c.obj -c /workspace/srcdir/MobilityDB/meos/postgres/port/pg_bitutils.c
/tmp/ccIjAGDk.s: Assembler messages:
/tmp/ccIjAGDk.s:109: Error: incorrect register `%eax' used with `q' suffix
make[2]: *** [meos/postgres/port/CMakeFiles/port.dir/build.make:77: meos/postgres/port/CMakeFiles/port.dir/pg_bitutils.c.obj] Error 1
make[2]: Leaving directory '/workspace/srcdir/MobilityDB/build'
make[1]: *** [CMakeFiles/Makefile2:1192: meos/postgres/port/CMakeFiles/port.dir/all] Error 2
make[1]: Leaving directory '/workspace/srcdir/MobilityDB/build'
make: *** [Makefile:146: all] Error 2
To Reproduce
Steps to reproduce the behavior:
The Julia recipe is here, but in short this is using a mingw toolchain and the following statements using the 1.2.0 rc1 release using a git checkout.
cd $WORKSPACE/srcdir/MobilityDB
cmake -B build -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DMEOS=ON -DHAVE_X86_64_POPCNTQ_EXITCODE="FAILED_TO_RUN" -DHAVE_X86_64_POPCNTQ_EXITCODE__TRYRUN_OUTPUT=
cmake --build buildNote I needed to set DHAVE_X86_64_POPCNTQ cache variables because the TRY_RUN cmake is not supported in cross-compilation mode. While related to the failed portion of code, setting the exit code to either zero or one does not make a difference.
Apart from many warnings (overflows) the rest of the codebase seems to cross-compile fine.
Additional context
Related to #513.