Modify optimize-testing instructions

Mention -flto and whole-program optimization as this is the most
important aspect.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2023-10-19 15:22:15 +01:00
parent 3f7e42a750
commit a72b4ca734

View File

@ -239,7 +239,8 @@ Copy what needs copying. This is broadly straightforward, however there are a fe
It is unclear whether the compiler will attempt to optimize away copying operations.
Once the copying code is implemented, it should be evaluated to see whether compiler optimization is a problem. Specifically, for the major compilers and platforms supported by Mbed TLS:
* Build Mbed TLS with the compiler set to a high level of optimization (e.g. `-O2` for `gcc`).
* Write a small program that uses a PSA function which copies inputs or outputs.
* Build the program with link-time optimization / full-program optimization enabled (e.g. `-flto` with `gcc`).
* Inspect the generated code with `objdump` or a similar tool to see if copying operations are preserved.
If copying behaviour is preserved by all major compilers and platforms then assume that compiler optimization is not a problem.