I met the following error when building in a clean chroot:
Checking that the C++ compiler can link a C++ program... no
C++ compiler g++ can't link C++ programs
See /build/mongodb/src/mongodb-src-r6.0.4/build/scons/config.log for details
==> ERROR: A failure occurred in build().
Aborting...
==> ERROR: Build failed, check /var/lib/archbuild/extra-x86_64/gnaggnoyil/build
And the config.log
has the following error message:
scons: Configure: Checking that the C++ compiler can link a C++ program...
build/scons/07c20a8e/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.cpp <-
|
|#include <iostream>
|#include <cstdlib>
|
|int main() {
| std::cout << "Hello, World" << std::endl;
| return EXIT_SUCCESS;
|}
|
g++ -o build/scons/07c20a8e/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.o -c -Woverloaded-virtual -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/mongodb/src=/usr/src/debug/mongodb -flto=auto -Werror -ffp-contract=off -fasynchronous-unwind-tables -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -fno-omit-frame-pointer -fno-strict-aliasing -O0 -mprefer-vector-width=128 -D_XOPEN_SOURCE=700 -D_GNU_SOURCE build/scons/07c20a8e/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.cpp
In file included from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/os_defines.h:39,
from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/c++config.h:655,
from /usr/include/c++/12.2.1/iostream:38,
from build/scons/07c20a8e/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.cpp:2:
/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
412 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
| ^~~~~~~
cc1plus: all warnings being treated as errors
scons: Configure: no
What could possibly go wrong here?
Pinned Comments
JstKddng commented on 2022-08-03 23:28 (UTC)
Binary builds are available:
https://software.opensuse.org//download.html?project=home%3Ajustkidding%3Aarch&package=mongodb
JstKddng commented on 2022-08-03 23:28 (UTC)
If you have a pre-sandybridge CPU or an ARMv8 sbc, you can use mongodb44
If you'd like to stay in the V5.0 branch, you can use mongodb50
JstKddng commented on 2022-08-03 23:25 (UTC)
The
mongo
utility will be removed in future releases. Switching tomongosh
is recommended.