FoldingAtHome / fah-client-bastet

Folding@home client, code named Bastet
GNU General Public License v3.0
60 stars 10 forks source link

Compile issue on Raspberry Pi 5 #230

Closed yipikaye closed 5 months ago

yipikaye commented 5 months ago

There seems to be an issue with librarys?

ash@pi5:~ $ scons -C fah-client-bastet
scons: Entering directory `/home/ash/fah-client-bastet'
scons: Reading SConscript files ...
   Compiler: gcc (gnu)
   Platform: posix
       Mode: gnu
       Arch: None
GCC Version: 12
       Jobs: 4
Checking for C library pthread... (cached) yes
Checking for C header file zlib.h... (cached) yes
Checking for C library z... (cached) yes
Checking for C header file bzlib.h... (cached) yes
Checking for C library bz2... (cached) yes
Checking for C header file expat.h... (cached) yes
Checking for C library expat... (cached) yes
Checking for C header file pthread.h... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library dl... (cached) yes
Checking for C library sqlite3... (cached) yes
Checking for C header file sqlite3.h... (cached) yes
Checking for C function sqlite3_backup_init()... (cached) yes
Checking for C header file yaml.h... (cached) yes
Checking for C library yaml... (cached) yes
Checking for C library snappy... (cached) yes
Checking for C library leveldb... (cached) yes
Checking for C++ header file leveldb/db.h... (cached) yes
Checking for C header file mysql/mysql.h... (cached) yes
Checking for C library mariadbclient... (cached) yes
Checking for C function mysql_real_connect_start()... (cached) yes
Checking for C library lz4... (cached) yes
Checking for C function clock_gettime()... (cached) yes
Checking for C header file event2/event.h... (cached) yes
Checking for C library event... (cached) yes
Checking for C++ header file re2/re2.h... (cached) yes
Checking for C library re2... (cached) yes
Checking for C function epoll_create1()... (cached) yes
Checking for C library dl... (cached) yes
Checking for C header file openssl/ssl.h... (cached) yes
Checking for C library crypto... (cached) yes
Checking for C library ssl... (cached) yes
Checking for openssl version >= 1.1.0...(cached) yes
Checking for C++ header file v8.h... (cached) yes
Checking for C++ header file libplatform/libplatform.h... (cached) yes
Checking for C library v8_monolith... no
Checking for C library v8... (cached) yes
Checking for C library v8_libplatform... (cached) yes
Checking for C header file pthread.h... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C header file systemd/sd-bus.h... (cached) yes
Checking for C library systemd... (cached) yes
Checking for C library cap... yes
Checking for C header file valgrind/valgrind.h... (cached) yes
Checking for C header file valgrind/drd.h... (cached) yes
Checking for C header file valgrind/helgrind.h... (cached) yes
Checking for C header file valgrind/memcheck.h... (cached) yes
Checking for C library cbang-boost... yes
Checking for C library cbang... yes
Checking for C++ header file cbang/Exception.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
build_function(["build/build_info.cpp"], [])
g++ -o fah-client -Wl,--as-needed -Wl,-s -Wl,-x -Wl,--gc-sections -no-pie -pthread -static-libstdc++ -static-libgcc -Wl,--wrap=glob -Wl,--wrap=logf -Wl,--wrap=log -Wl,--wrap=expf -Wl,--wrap=exp -Wl,--wrap=powf -Wl,--wrap=pow -Wl,--wrap=fcntl64 build/client.o build/fah/client/Account.o build/fah/client/App.o build/fah/client/Config.o build/fah/client/Core.o build/fah/client/CoreState.o build/fah/client/Cores.o build/fah/client/ExitCode.o build/fah/client/GPUResource.o build/fah/client/GPUResources.o build/fah/client/Group.o build/fah/client/Groups.o build/fah/client/NodeRemote.o build/fah/client/OS.o build/fah/client/PasskeyConstraint.o build/fah/client/Remote.o build/fah/client/RunResult.o build/fah/client/Server.o build/fah/client/Unit.o build/fah/client/UnitState.o build/fah/client/Units.o build/fah/client/WebsocketRemote.o build/fah/client/glibc.o build/libfahclient-resources.a build/fah/client/lin/LinOSImpl.o build/build_info.o -L/home/ash/cbang/lib -Wl,--start-group /home/ash/cbang/lib/libcbang.a /home/ash/cbang/lib/libcbang-boost.a /usr/lib/arm-linux-gnueabihf/libcap.a -lsystemd -lpthread -lv8_libplatform -lv8 /usr/lib/arm-linux-gnueabihf/libssl.a /usr/lib/arm-linux-gnueabihf/libcrypto.a -ldl /home/ash/cbang/lib/libre2.a /home/ash/cbang/lib/libevent.a /home/ash/cbang/lib/liblz4.a -lmariadbclient /usr/lib/arm-linux-gnueabihf/libleveldb.a /usr/lib/arm-linux-gnueabihf/libsnappy.a /home/ash/cbang/lib/libyaml.a /home/ash/cbang/lib/libsqlite3.a -ldl -lpthread /usr/lib/arm-linux-gnueabihf/libexpat.a -lbz2 -lz -lpthread -Wl,--end-group
/usr/bin/ld: build/fah/client/glibc.o: in function `__wrap_log':
glibc.c:(.text.__wrap_log+0x0): undefined reference to `log@GLIBC_2.2.5'
/usr/bin/ld: build/fah/client/glibc.o: in function `__wrap_pow':
glibc.c:(.text.__wrap_pow+0x0): undefined reference to `pow@GLIBC_2.2.5'
/usr/bin/ld: build/fah/client/glibc.o: in function `__wrap_fcntl64':
glibc.c:(.text.__wrap_fcntl64+0x134): undefined reference to `fcntl@GLIBC_2.2.5'
/usr/bin/ld: glibc.c:(.text.__wrap_fcntl64+0x14c): undefined reference to `fcntl@GLIBC_2.2.5'
/usr/bin/ld: glibc.c:(.text.__wrap_fcntl64+0x19c): undefined reference to `fcntl@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libcrypto.a(libcrypto-lib-threads_pthread.o): in function `CRYPTO_atomic_or':
(.text+0x1ec): undefined reference to `__atomic_is_lock_free'
/usr/bin/ld: (.text+0x298): undefined reference to `__atomic_fetch_or_8'
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libcrypto.a(libcrypto-lib-threads_pthread.o): in function `CRYPTO_atomic_load':
(.text+0x2e8): undefined reference to `__atomic_is_lock_free'
/usr/bin/ld: (.text+0x360): undefined reference to `__atomic_load_8'
collect2: error: ld returned 1 exit status
scons: *** [fah-client] Error 1
scons: building terminated because of errors.
jcoffland commented 5 months ago

Are you building in 32-bit mode on ARM? This is not supported. You need a 64-bit OS.

yipikaye commented 5 months ago

64bit ARM

$ uname -a
Linux pi5 6.6.25-v8+ #1753 SMP PREEMPT Wed Apr 10 17:38:05 BST 2024 aarch64 GNU/Linux
jcoffland commented 5 months ago

Something's strange here because your compiler has not defined the symbol __aarch64__ otherwise the GLIBC_2.17 symbols would be included which usually works on 64-bit ARM. Note the error undefined reference to `log@GLIBC_2.2.5'.

undefined reference to `__atomic_is_lock_free' may be a second problem.

Are you using a stock or custom OS for the RPI5?

yipikaye commented 5 months ago

Stock Raspbian OS.

Strangely I'm sure I've recently compiled other apps with no issues.

ash@pi5:~ $ raspinfo 
System Information
------------------

Raspberry Pi 5 Model B Rev 1.0
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"

Raspberry Pi reference 2023-10-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, fb56ad562991cf3ae5c96ab50983e1deeaefc7b6, stage4

Linux pi5 6.6.25-v8+ #1753 SMP PREEMPT Wed Apr 10 17:38:05 BST 2024 aarch64 GNU/Linux
Revision    : d04170
Serial      : 009b101649bbb37a
Model       : Raspberry Pi 5 Model B Rev 1.0
Throttled flag  : throttled=0x0
Camera          : vc_gencmd_read_response returned -1 error=1 error_msg="Command not registered"
jcoffland commented 5 months ago

Try my latest fah-client-bastet commit. It disabled glibc wrapping by default. This should work around the issue with your build.