4.2.1.19 The lto test

  Problem:  When LTO is supported by the compiler, it should be used
  Fix By:   Using -flto consistently
  Waive If: LTO building is not wanted

  Example:  FAIL: no indication of LTO, possibly -fno-lto was used

This test checks to see if the -flto compiler command line option was used. Using link time optimization produces better code and allows for more compile-time security checks to be run. Hence if it is supported by the compiler it should be used.

Annocheck is currently unable to distinguish between code that has been compiled with the -fno-lto option and code that has not been compiled with any -flto option, which is why the failure message is so vague.

Note - this test is automatically disabled if the --profile=el7 or --profile=el8 option is used.

If necessary the test can be disabled via the --skip-lto option and re-enabled via the --test-lto option.