]> Git Repo - linux.git/commit
x86, lto: Pass -stack-alignment only on LLD < 13.0.0
authorTor Vic <[email protected]>
Thu, 10 Jun 2021 20:58:06 +0000 (20:58 +0000)
committerKees Cook <[email protected]>
Fri, 11 Jun 2021 17:33:45 +0000 (10:33 -0700)
commit2398ce80152aae33b9501ef54452e09e8e8d4262
tree60111bfca3f0cf97cdad8393c542528d8b3106fd
parent06af8679449d4ed282df13191fc52d5ba28ec536
x86, lto: Pass -stack-alignment only on LLD < 13.0.0

Since LLVM commit 3787ee4, the '-stack-alignment' flag has been dropped
[1], leading to the following error message when building a LTO kernel
with Clang-13 and LLD-13:

    ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument
    '-stack-alignment=8'.  Try 'ld.lld --help'
    ld.lld: Did you mean '--stackrealign=8'?

It also appears that the '-code-model' flag is not necessary anymore
starting with LLVM-9 [2].

Drop '-code-model' and make '-stack-alignment' conditional on LLD < 13.0.0.

These flags were necessary because these flags were not encoded in the
IR properly, so the link would restart optimizations without them. Now
there are properly encoded in the IR, and these flags exposing
implementation details are no longer necessary.

[1] https://reviews.llvm.org/D103048
[2] https://reviews.llvm.org/D52322

Cc: [email protected]
Link: https://github.com/ClangBuiltLinux/linux/issues/1377
Signed-off-by: Tor Vic <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
arch/x86/Makefile
This page took 0.049224 seconds and 4 git commands to generate.