I don't see any easy solution for you at the moment, you need a binutils/gcc upgrade, or you need to put crc code in separate files. Or you could force all files to be compiled with -mcpu=generic, and then you can use .cpu to add/remove crc support as necessary.
Thanks Jim. This came from Jiong Wang on the Binutils mailing list (https://sourceware.org/ml/binutils/2017-04/msg00171.html):
__inline unsigned int GCC_INLINE_ATTRIB CRC32B(unsigned int crc, unsigned char v) { unsigned int r; asm ("\t.set raw_x0, 0\n" "\t.set raw_x1, 1\n" "\t.set raw_x2, 2\n" "\t.set raw_x3, 3\n" "\t.set raw_x4, 4\n" "\t.set raw_x5, 5\n" "\t.set raw_x6, 6\n" "\t.set raw_x7, 7\n" "\t#crc32w %w2, %w1, %w0\n" "\t.inst\t0x1ac04800 | (raw_%2) | (raw_%1 << 5) | (raw_%0 << 16)\n" : "=r"(r) : "r"(crc), "r"((unsigned int)v) ); return r; }
Thanks for the help (and thanks to the Binutil folks). I would not have gotten this far on my own.
Jeff