From: Paul Floyd Date: Sun, 21 Jan 2024 20:33:06 +0000 (+0100) Subject: Bug 480126 - Build failure on Raspberry Pi 5 / OS 6.1.0-rpi7-rpi-v8 X-Git-Tag: VALGRIND_3_23_0~203 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bdb86cc9a962f04f2dd3816b7d3a96288b09b72;p=thirdparty%2Fvalgrind.git Bug 480126 - Build failure on Raspberry Pi 5 / OS 6.1.0-rpi7-rpi-v8 The problem is that the Pi 3+ with raspbian has a 64bit aarch64 OS but a 32bit gnueabihf userland. If you just run "configure" the result will be an attempt to use 32-bit GCC with the ARM64 Valgrind platform, which will fail. This can be fixed by using the appropriate --host= option. I've updated README.aarch64 with a description of this. I've also changed configure.ac to take "arm*" for the ARM platform (previously it was "armv7*"). That's been a patch on Debian for a while. It will allow building on older arm hardware and also armv8 (used on the Raspberry Pi 3 and later models). --- diff --git a/NEWS b/NEWS index 1aaea80114..5f1f2f5d95 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 478837 valgrind fails to read debug info for rust binaries 479041 Executables without RW sections do not trigger debuginfo reading 480052 WARNING: unhandled amd64-freebsd syscall: 580 +480126 Build failure on Raspberry Pi 5 / OS 6.1.0-rpi7-rpi-v8 n-i-bz Add redirect for memccpy To see details of a given bug, visit diff --git a/README.aarch64 b/README.aarch64 index 2d6c93602f..1a74d9d015 100644 --- a/README.aarch64 +++ b/README.aarch64 @@ -238,3 +238,25 @@ inline scalar code chainXDirect_ARM64: use direct jump forms when possible + + +Raspberry Pi +~~~~~~~~~~~~ + +The Raspberry Pi since version 3 has had 64 bit hardware (aarch64). However, +Raspberry Pi OS (formerly raspbian) has a 32-bit userland. You can check +this using commands like file, ldd or readelf. For instance, + +$ file -L `which gcc` +/usr/bin/gcc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=6cfb4b75e1e265eb5a05ef0a1915bca9bae34674, for GNU/Linux 3.2.0, stripped + +As a consequence, if you try to run just "configure" it will detect aarch64 and +select the "arm64" target, which is incorrect for the 32-bit userland. + +Instead you should run + +configure --host=armv8-unknown-linux + +That will override the aarch64 detection and result in a 32bit build of +Valgrind for the "arm" target. + diff --git a/configure.ac b/configure.ac index 5d491b9c3b..2acb7023e2 100755 --- a/configure.ac +++ b/configure.ac @@ -271,7 +271,7 @@ case "${host_cpu}" in ARCH_MAX="s390x" ;; - armv7*) + arm*) AC_MSG_RESULT([ok (${host_cpu})]) ARCH_MAX="arm" ;;