We have a problem when building compiler-rt for aarch64 with 5.0 branch based clang. The issue is while compiling compiler-rt
lib/scudo/scudo_crc32.cpp
#if defined(SSE4_2) || defined(__ARM_FEATURE_CRC32)
u32 computeHardwareCRC32(u32 Crc, uptr Data) {
return CRC32_INTRINSIC(Crc, Data);
}
here We see that when using -march=armv8-a on clang cmdline __ARM_FEATURE_CRC32 gets defined which I doubt is right it should
only get defined when -march=armv8-a+crc or -march=armv8.1-a, what we see in compiler-rt cmake system groks for crc support and if
it sees the support it add -mcrc to cmdline which seems correct howvever clang does not translate this correctly to assembler cmdline
and it endup with errors like
/tmp/tmp.TPh21LESIa/scudo_crc32-b4bfcd.s: Assembler messages:
/tmp/tmp.TPh21LESIa/scudo_crc32-b4bfcd.s:14: Error: selected processor does not support `crc32cx w0,w0,x1'
This change work arounds the clang drivers issues by replacing -mcrc with -march=armv8.1-a which has the same effect but
helps the clang driver to call assembler with right options.