title: Linker error when enabling Link Time Optimization in NDK
body: <p>When I add the flag <code>-flto</code> to my NDK C++ project the linker emits the following error: "Optimization level must be between 0 and 3", even though my optimization level is explicitly set to 3 via <code>-O3.</code></p>
  
  <p>Does anyone know how to solve this?</p>
  
  <p>The compiler flags are passed via Gradle which, as I understand it, should pass the flags to both the Clang compiler and linker. When I remove the <code>-flto</code> flag everything works fine.</p>
  
  <p><em>Notes:</em> </p>
  
  <ul>
  <li><p>I'm using NDK 19.2 (latest version at the time I write this).</p></li>
  <li><p>I also get the warning <code>"clang++.exe: warning: argument unused during compilation: '-Wa,--noexecstack' [-Wunused-command-line-argument]"</code> which I do not have if I compile without link time optimizations.</p></li>
  </ul>