include: provide compiler attribute macros

In the new compiler.h, provide shorthand macros for various type and
function attributes, such as __attribute__((weak)).

Replace uses of these around the OS.  Along the way, clean up many
redundant function prototypes.

Change-Id: Id9db43201f9115f5a380f368d72923d4d7f222f5