Enabling -O4 (link-time optimization) only if compiler/linker support it.

- The -O4 option requires the linker to have bitcode support, currently for
  clang this means using the gold linker and the LLVM-gold plugin:
  http://llvm.org/docs/GoldPlugin.html.
- Otherwise you get (confusing) 'file format not recognised' errors ala:
  http://llvm.org/bugs/show_bug.cgi?id=9897.
- Adding explicit check for LTO support as at least some package installs of
  clang on linux do not use the gold linker by default.

Change-Id: I2a4c670e470d9b48da2a15b7e91a59fb4ad3e8ad
1 file changed