Build: Add a check for __attribute__((__always_inline__)).
All even remotely relevant GCC and Clang versions support this
attribute. The test is useful to detect support in compilers that
don't define __GNUC__ or __clang__, for example, Solaris Studio.
This matches the modified m4/ax_gcc_func_attribute.m4.
Only constructor and ifunc attribute checks were implemented.
CMake-based build doesn't have the trouble of Autoconf confdefs.h
but writing warning-free tests would still some extra care.
If looking for attribute-related warnings works well enough then
this method should be nicer than the -Werror method in CMake too.
Build: Use AX_GCC_FUNC_ATTRIBUTE to detect __attribute__ support.
This way -Werror isn't needed for these checks as
AX_GCC_FUNC_ATTRIBUTE looks at compiler's warning messages to see
if an unsupported attribute was present. Both methods have their
own problems but I'm hoping that this is the better method.
It is known that the check for the ifunc attribute this doesn't
work with CompCert 3.12. It silently ignores unknown attributes
in function declarations and in static functions if the function
appears unused (even though the unknown attribute would make it used).
Build: Fix ax_gcc_func_attribute.m4 for compilers other than GCC >= 4.6.
With other compilers it accepted all attributes as it didn't recognize
the warning messages about unsupported attributes. The problem occurs
only with compilers that warn instead of error when an unsupported
attribute is seen.
CMake: Don't assume that -fvisibility=hidden is supported outside Windows.
The original code was good enough for supporting GNU/Linux
and a few others but it wasn't very portable.
CMake doesn't support Solaris Studio's -xldscope=hidden.
If it ever does, things should still work with this commit
as Solaris Studio supports not only its own __global but also
the GNU C __attribute__((visibility("default"))). Support for the
attribute was added in 2007 to Sun Studio 12 compiler version 5.9.