GCC 5.1.0 producing invalid Clang binaries?


Trying to build a (somewhat) fresh Clang to run on a rather old
machine, I've attempted to use GCC 5.1.0 compiled according to the
instructions at
It turned out that the resulting Clang binaries crash on a trivial
assembly file (reduced from the Linux kernel source):

$ cat trampoline_64.s
$ clang -m16 -c -o trampoline_64.o trampoline_64.s -w
clang-10: /home/glider/llvm-project/llvm/lib/Target/X86/AsmParser/X86AsmPar=
void {anonymous}::X86AsmParser::SwitchMode(unsigned int): Assertion
`FeatureBitset({mode}) =3D=3D (STI.getFeatureBits() & AllModes)' failed.

The same Clang version (c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
works perfectly fine when compiled with a newer GCC 8.3.0.
Could it be so that GCC 5.1.0 miscompiles Clang and thus shouldn't be
used as the minimum build requirement?

We had problems with GCC 5.1.0 when building Clang for Chromium
(crbug.com/994556 and crbug.com/998569). Actually your problem sounds
maybe related to the second of those. We've since switched to GCC
5.3.0 which someone said is supposed to be better, and I don't recall
any problems with that yet.