Exec format error is coming for sanitycheckc.exe while cross compiling the glib for mips64 variant
Hi Team,
We are trying to build ( cross compiling) the glib-2.68.3 for mips64 variant with the below options and it's getting failed at sanity check point.
+ meson --prefix=/usr -Dman=true --libdir=lib64 -Ddebug=true -Dselinux=disabled -Dlibmount=disabled ..
The Meson build system
Version: 0.56.0
Source dir: /home/FPTR/distro/work/mips64/glib-2.68.3
Build dir: /home/FPTR/distro/work/mips64/glib-2.68.3/build
Build type: native build
Project name: glib
Project version: 2.68.3
Using 'CC' from environment with value: 'mips64-linux-gnu-gcc'
../meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/FPTR/distro/work/mips64/glib-2.68.3/build/meson-private/sanitycheckc.exe'.
A full log can be found at /home/FPTR/distro/work/mips64/glib-2.68.3/build/meson-logs/meson-log.txt
Below is the cross file what we have used and how we are building it.
cat <<EOF > "cross_file.txt"
[binaries]
c = '${TOOL_TRIPLET}-gcc'
cpp = '${TOOL_TRIPLET}-g++'
ar = '${TOOL_TRIPLET}-ar'
strip = '${TOOL_TRIPLET}-strip'
pkgconfig = '${BASEDIR}/scripts/pkg-config'
[build_machine]
system = 'linux'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
[host_machine]
system = 'linux'
cpu_family = '${HW_ARCH}'
cpu = '${HW_ARCH}'
endian = '${endianness}'
[properties]
c_args = [ '--sysroot=${BUILD_ROOTFS}']
c_link_args = [ '--sysroot=${BUILD_ROOTFS}' ]
cpp_args = ['--sysroot=${BUILD_ROOTFS}' ]
cpp_link_args = [ '--sysroot=${BUILD_ROOTFS}' ]
EOF
mkdir build && cd build
CC=${TOOL_TRIPLET}-gcc CXX=${TOOL_TRIPLET}-g++ meson --prefix=/usr \
-Dman=true \
--libdir="$LIB_NAME" \
-Ddebug=true \
-Dselinux=disabled -Dlibmount=disabled ..
ninja
DESTDIR="$PKG_STAGING" ninja install
Kindly can someone help me to resolve this issue.
Edited by Emmanuele Bassi