Add kludges for old gcc builds of compiler-rt builtins
Only use the libgcc_cmp_return mode attribute for gcc > 4.2, as it
was only introduced in gcc 4.3.0.
Don't use __has_include() for old gcc (actually cpp), as this results in
'missing binary operator before token "("' errors. Also add a forced
<stdbool.h> include, since old gcc refuses to recognize the 'bool' type
in freestanding mode.
Use the inline __builtin_sadd_overflow() implementation (originally
provided for MSVC) for gcc < 5.0, as it was only introduced in gcc 5.0.
NOTE: since the llvm project requires at least gcc >= 5.1, these kludges
should not be upstreamed.