Compile Mender for `mipsel` (32bit) architecture

stwirth
Fri, 11 Nov 2022 13:47:16 +0000
General Discussions

I’m trying to get Mender running on a MIPS-based 32bit SoC.
Build environment is buildroot 2020.02.1. Here are some relevant configuration variables:

# BR2_mips is not set
BR2_mipsel=y
# BR2_mips64 is not set
# BR2_mips64el is not set
BR2_ARCH="mipsel"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_ARCH="mips32r2"
BR2_GCC_TARGET_ABI="32"
BR2_GCC_TARGET_NAN="2008"
BR2_GCC_TARGET_FP32_MODE="64"
BR2_BINFMT_SUPPORTS_SHARED=y
BR2_READELF_ARCH_NAME="MIPS R3000"
BR2_BINFMT_ELF=y
BR2_MIPS_CPU_MIPS32R5=y
# BR2_mips_32 is not set
# BR2_mips_32r2 is not set
# BR2_mips_32r3 is not set
# BR2_mips_32r5 is not set
# BR2_mips_32r6 is not set
# BR2_mips_interaptiv is not set
# BR2_mips_m5150 is not set
# BR2_mips_m6250 is not set
# BR2_mips_p5600 is not set
# BR2_mips_xburst is not set
BR2_mips_xburst2=y
# BR2_MIPS_SOFT_FLOAT is not set
# BR2_MIPS_FP32_MODE_32 is not set
# BR2_MIPS_FP32_MODE_XX is not set
BR2_MIPS_FP32_MODE_64=y
BR2_MIPS_NAN_2008=y
BR2_MIPS_OABI32=y

First of all, I was not able to select mender in buildroot-menuconfig because of

# Target go packages should depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  bool
  default y
  depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_20006
  depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS
  depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \
    || BR2_i386 || BR2_x86_64 || BR2_powerpc64le \
    || BR2_mips64 || BR2_mips64el

As 32bit MIPS should be supported by go (see Go on ARM and Beyond - The Go Programming Language), I just added BR2_mipsel to the list. With that mender shows up as available package but it does not compile:

mips-linux-gnu-gcc: error: unrecognized command line option '-m64'

I updated the mender version to 3.4.0 with the same effect.

What can I try next?

EDIT:
I got one step further by adding

else ifeq ($(BR2_mipsel),y)
GO_GOARCH = mipsle

to go/go.mk.

Now the build fails with

# runtime/cgo
cc1: error: the 'mips32' architecture does not support '-mnan=2008' [-Werror]
cc1: all warnings being treated as errors

4 posts - 2 participants

Read full topic