Consistently use COMPILER_RT_ABI for all public symbols.

Move prototypes into headers and fix a few inconsistencies.

Imported as in bfbb8bbc8e4a4fce3538aa85b095543fee291df7.
Applied cleanly, although the path to the files changed.

ae87ccaedad6737817cd296824b56615fb5f1556 is also needed
and included.

clear cache changed according to 76a80b1b277c477cd1a2fbee4f9b024bb1bc56c6
and 8554b6b336c08d813b59a4f2383e31b22f30e4dd.