FreeBSD does include use clang by default nowadays.
I use FreeBSD's poudriere to build within a jail. The latest compilation log I have is this one: https://poudriere.cyberbotx.com:8766/data/local_aarch64-default/2020-07-21_23h45m55s/logs/mariadb105-server-10.5.4_1.log (I was building with debug symbols to narrow down where the crash occurred.) The -march flag is not compatible with the Raspberry Pi 3, but the -mcpu flag is, although I was getting the crash even when it wasn't in use. (I am using it set to cortex-a53 as that is the processor that the Raspberry Pi 3 uses.)
I believe the reason it gets included is that it is a valid language extension for the Cortex-A53, but from talking to others that work with FreeBSD, it does indeed require special permissions to be used from userspace. I believe by default it can only be used from the kernel, at least under FreeBSD and possibly under Linux. I have seen that the Android application Termux, which is a terminal emulator and Linux environment app, has a package for MariaDB and includes a similar patch to the one in the initial report, albeit using __ANDROID__ instead of __arm__.
I don't have an easy way to get to the generated code within the build jail, but asking around, it seems that FreeBSD does not have the gethrtime() function, so it would return 0.
If it also helps, this is a gdb run before the patch that I was asked to generate by another user: https://pastebin.com/u3GAKw8r This is what led us to seeing that the __builtin_readcyclecounter call was causing the SIGILL.
I forgot to mention which commit did this: https://github.com/MariaDB/server/commit/5e929ee8a0487f8929386031e84b1884f503eb48