Bug in the build system? Documentation not up to date?

I want to compile px4 on raspi using clang.
First I need to check if it can be compiled successfully without using clang. I tried it using make emlid_navio2 and it came up with the following error:

/home/pi/PX4-Autopilot/platforms/common/include/px4_platform_common/atomic.h:76:41: **error: static assertion failed: atomic is not lock-free for the given type T
static_assert(__atomic_always_lock_free(sizeof(T), 0), "atomic is not lock-free for the given type T");
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.**

I also used clang cross compilation as per the documentation Clang (optional) but it doesn’t work.This can be seen in detail in [Bug] PX4’s compilation behavior does not match the documented description.

Is there anyone who can help me?