Source: mayo
Version: 0.9.0+ds-2
Severity: serious
Tags: FTBFS, patch
User: debian-ri...@lists.debian.org
Usertags: riscv64

Dear mayo maintainer,
The package mayo build failed on riscv64.The crucial buildd log below:
```

/build/reproducible-path/mayo-0.9.0+ds/src/3rdparty/fast_float/float_common.h:21:2:
error: #error Unknown platform (not 32-bit, not 64-bit?)
   21 | #error Unknown platform (not 32-bit, not 64-bit?)
      |  ^~~~~
/build/reproducible-path/mayo-0.9.0+ds/src/3rdparty/fast_float/float_common.h:162:4:
error: #error Not implemented
  162 |   #error Not implemented
      |    ^~~~~
[ 26%] Building CXX object CMakeFiles/MayoCore.dir/src/base/xcaf.cpp.o
/usr/bin/c++ -DOCCT_HANDLE_NOCAST -DOCC_CONVERT_SIGNALS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQT_IMPLICIT_QFILEINFO_CONSTRUCTION
-I/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu/MayoCore_autogen/include
-I/build/reproducible-path/mayo-0.9.0+ds/src/3rdparty
-I/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu
-isystem /usr/include/opencascade -g -O2
-ffile-prefix-map=/build/reproducible-path/mayo-0.9.0+ds=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -std=gnu++17 -MD -MT
CMakeFiles/MayoCore.dir/src/base/xcaf.cpp.o -MF
CMakeFiles/MayoCore.dir/src/base/xcaf.cpp.o.d -o
CMakeFiles/MayoCore.dir/src/base/xcaf.cpp.o -c
/build/reproducible-path/mayo-0.9.0+ds/src/base/xcaf.cpp
[ 27%] Building CXX object CMakeFiles/MayoCore.dir/src/graphics/ais_text.cpp.o
/usr/bin/c++ -DOCCT_HANDLE_NOCAST -DOCC_CONVERT_SIGNALS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQT_IMPLICIT_QFILEINFO_CONSTRUCTION
-I/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu/MayoCore_autogen/include
-I/build/reproducible-path/mayo-0.9.0+ds/src/3rdparty
-I/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu
-isystem /usr/include/opencascade -g -O2
-ffile-prefix-map=/build/reproducible-path/mayo-0.9.0+ds=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -std=gnu++17 -MD -MT
CMakeFiles/MayoCore.dir/src/graphics/ais_text.cpp.o -MF
CMakeFiles/MayoCore.dir/src/graphics/ais_text.cpp.o.d -o
CMakeFiles/MayoCore.dir/src/graphics/ais_text.cpp.o -c
/build/reproducible-path/mayo-0.9.0+ds/src/graphics/ais_text.cpp
make[3]: *** [CMakeFiles/MayoCore.dir/build.make:663:
CMakeFiles/MayoCore.dir/src/base/unit_system.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 27%] Building CXX object
CMakeFiles/MayoCore.dir/src/graphics/graphics_create_driver.cpp.o
/usr/bin/c++ -DOCCT_HANDLE_NOCAST -DOCC_CONVERT_SIGNALS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQT_IMPLICIT_QFILEINFO_CONSTRUCTION
-I/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu/MayoCore_autogen/include
-I/build/reproducible-path/mayo-0.9.0+ds/src/3rdparty
-I/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu
-isystem /usr/include/opencascade -g -O2
-ffile-prefix-map=/build/reproducible-path/mayo-0.9.0+ds=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -std=gnu++17 -MD -MT
CMakeFiles/MayoCore.dir/src/graphics/graphics_create_driver.cpp.o -MF
CMakeFiles/MayoCore.dir/src/graphics/graphics_create_driver.cpp.o.d -o
CMakeFiles/MayoCore.dir/src/graphics/graphics_create_driver.cpp.o -c
/build/reproducible-path/mayo-0.9.0+ds/src/graphics/graphics_create_driver.cpp
make[3]: Leaving directory
'/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:109: CMakeFiles/MayoCore.dir/all] Error 2
make[2]: Leaving directory
'/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu'
make[1]: *** [Makefile:94: all] Error 2
make[1]: Leaving directory
'/build/reproducible-path/mayo-0.9.0+ds/obj-riscv64-linux-gnu'
dh_auto_build: error: cd obj-riscv64-linux-gnu && make -j4
"INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2

```
The full buildd log is here:
https://buildd.debian.org/status/fetch.php?pkg=mayo&arch=riscv64&ver=0.9.0%2Bds-2&stamp=1744889134&raw=0

My solution to this issue:
The bundled fast_float library (version included in mayo 0.9.0+ds) does not
have preprocessor checks to identify the riscv64 architecture.It fails to
define FASTFLOAT_64BIT for this platform, leading to the above errors as
the code falls through to unimplemented/error sections.The issue can be
fixed by patching src/3rdparty/fast_float/float_common.h to recognize
riscv64 as a 64-bit architecture using the standard __riscv and
__riscv_xlen macros. This allows the existing code path that uses
__uint128_t (available on riscv64 with GCC/Clang) to be used for 128-bit
multiplication within the library. The debdiff patch is in the attachment.I
have tested that locally, and it works well.Please let me know whether this
solution can be accepted.

Thank you for maintaining mayo.

Gui-Yue
Best Regards

Attachment: support_riscv_for_mayo.patch
Description: Binary data

Reply via email to