Hi, like others before me, I’m having problems cross compiling mongodb - this is to run mongod version 5 on a Pi 4b system. I cloned the mongo repository off git (not entirely sure how to ensure version 5).
Documentation I’ve found is out of date (e.g. Ubuntu 20.0.4 doesn’t have g++ version 11.3). So, I built a Fedora 37 system and that compiles mongod for itself, so all good. I then install the Fedora aarch64 toolchain (inc binutils-aarch64-linux-gnu) and aarch64-linux-gnu-gcc-g++ and run this command:
python buildscripts/scons.py DESTDIR=/opt/mongodb CCFLAGS=-march=armv8.3-a CC=/usr/bin/aarch64-linux-gnu-gcc CXX=/usr/bin/aarch64-linux-gnu-g++ install-mongod
The python reqs pass, then:
scons version: 3.1.2
python version: 3 11 1 'final' 0
Mkdir("build/tmp_test_data")
CC is /usr/bin/aarch64-linux-gnu-gcc
CXX is /usr/bin/aarch64-linux-gnu-g++
Checking if dev env is valid... skipped
Checking if C++ compiler "/usr/bin/aarch64-linux-gnu-g++" is GCC... yes
Checking if C compiler "/usr/bin/aarch64-linux-gnu-gcc" is GCC... yes
Detected a aarch64 processor
Checking if target OS linux is supported by the toolchain... yes
Checking if C compiler is GCC 11.3 or newer...yes
Checking if C++ compiler is GCC 11.3 or newer...yes
Checking if linker supports -fuse-ld=lld... no
The recommended linker 'lld' is not supported with the current compiler configuration, you can try the 'gold' linker with '--linker=gold'
I tried ‘–linker=gold’ and has this response:
Checking if linker supports -fuse-ld=gold... no
Linker gold could not be configured.
Looking at the build/scons/config.log, it is missing stdlib.h:
build/scons/opt/sconf_temp/conftest_25fe9b7eeda4aef15b03635be7f9c29c_0.c:2:10: fatal error: stdlib.h: No such file or directory
/usr/aarch64-linux-gnu/sys-root is empty (no include, let alone header files - I assume this is where they are supposed to be). Is there some particular toolchain I should be using instead of the Fedora one? Or is there really a problem with lld?
thanks.