As pointed out by @samitolvanen and then confirmed by @nickdesaulniers here - https://github.com/ClangBuiltLinux/linux/issues/1737 - -flto=thin does not reliably know about address-taken properties across different translation units. This breaks the assumptions behind the -mibt-seal optimization, that removes ENDBR instructions from prologues of functions which are observed as non-address-taken.
Thus, because of the above, prevent -mibt-seal from being used together with -flto=thin by only enabling it if lto is Full.
Please run git clang-format for the patch.