Hi all.
I was having an issue getting PHP-7.4.9 to build on a Raspberry Pi 3 Model B,
which uses a Broadcom BCM2835 SoC with Arm Cortex A53 CPU. The build kept
failing on ext/standard/crc32.c, stating the following error –
ext/standard/crc32.c - armv8-a does not support feature 'nothing'
Further up in the error, I found reference to line 48 in ext/standard/crc32.c –
# pragma GCC target ("+nothing+crc")
In some online searches, I had found where someone changed +nothing+crc to
arch=armv8-a+crc. I decided to give this a go. I deleted the untarred
directory, then untarred it again to start with a clean setup. I then made the
change to ext/standard/crc32.c, then ran the build.
With the aforementioned change, php built flawlessly.
The following patch should correct this issue –
Origin: Created by Jon Wilder at [email protected]
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -45,7 +45,7 @@ static inline int has_crc32_insn() {
}
# pragma GCC push_options
-# pragma GCC target ("+nothing+crc")
+# pragma GCC target ("arch=armv8-a+crc")
static uint32_t crc32_aarch64(uint32_t crc, char *p, size_t nr) {
while (nr >= sizeof(uint64_t)) {
crc = __crc32d(crc, *(uint64_t *)p);
For other Pi versions, replace the “arch=armv8-a” portion with the arch which
matches your Pi’s architecture.
Regards,
Jon
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page