MongoDB 4.4 ARM64 builds for Raspberry Pi 3 Debian Buster

Hello good morning, I’m creating a small application and my idea is to have a small embedded in an old raspberry pi 3 that I have. In my application I use mongo 4.4 and when I tried to install it I found that there were no pre-builds for arm64 so I started to investigate and found the next thread:

In this thread the following is mentioned to create a build using cross-compiling:

sudo apt-get install gcc-8-aarch64-linux-gnu g++-8-aarch64-linux-gnu
$ sudo dpkg --add-architecture arm64
$ sudo apt-get update
$ sudo apt-get install libssl-dev:arm64 libcurl4-openssl-dev:arm64

$ git clone -b r4.4.0
$ cd mongo

# Consider using a virtualenv for this
$ python3 -m pip install --user -r etc/pip/compile-requirements.txt

$ python3 buildscripts/ --ssl CC=/usr/bin/aarch64-linux-gnu-gcc-8 CXX=/usr/bin/aarch64-linux-gnu-g++-8 CCFLAGS="-march=armv8-a+crc -mtune=cortex-a72" --install-mode=hygienic --install-action=hardlink --separate-debug archive-core{,-debug}

and made some modifications to adapt it to the rapsberry pi 3:


Maybe the mistake is precisely that I ventured to just change that. However, I also did the test without making any modifications and the mistake is exactly the same(a53):

/usr/bin/objcopy --only-keep-debug build/opt/mongo/mongo build/opt/mongo/mongo.debug
scons: building terminated because of errors.
build/opt/mongo/mongo failed: Error 1

In doing some more research I found that apparently instead of /usr/bin/objcopy you should use /usr/bin/arm-linux-gnueabihf-objcopy but here I miss too much.

Basically I come to ask if I’m on the right track and if anyone knows how to fix it or if they’ve already encountered this same problem.

Thank you very much.

Hi Alvaro -

If you need to customize which objcopy is used, you can specify that on the SCons invocation just like you would the path to CC or CXX, like so:

scons ... OBJCOPY=/path/to/some/objcopy.

In your case, it looks like you would want scons ... OBJCOPY=/usr/bin/arm-linux-gnueabihf-objcopy

Hope that helps,

1 Like