Build breakage from renamed '-split-machine-functions' plugin option
Nathan Chancellor
maintainerHi Rong and Han,
LLVM recently landed a commit renaming the '-split-machine-functions' plugin option to '-function-splitting=all':
https://github.com/llvm/llvm-project/commit/3e6acc87c58843e551d6e8e4bf06c26712b04622
This breaks builds with CONFIG_AUTOFDO and CONFIG_LTO_CLANG_THIN with:
ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument '-split-machine-functions'. Try: 'ld.lld --help'
Obviously, we can handle this rename but I noticed that the combination of '-flto -fsplit-machine-functions' should add the corresponding '-plugin-opt=' since LLVM 15:
https://github.com/llvm/llvm-project/commit/72acd042bad35f78232f17addc02196a7af1a6e9
So is this even necessary? Should we just remove
KBUILD_LDFLAGS += -plugin-opt=-split-machine-functions
from scripts/Makefile.autofdo and rely on '-fsplit-machine-functions' to do the right thing or am I missing something here?
Signature · 2 lines
Cheers, Nathan
A message that is not in the archive (sent off-list or not yet received): CAF1bQ=Qq66JuvYrbR-7GgegZuWPSjxDOgerUSD2NOp9W0BauZw@mail.gmail.com
Sorry that if you receive duplicated email.
Thanks,
-Rong
Quoted 43 lines · Rong Xu
Hi Nathan,
Thanks for bringing this to our attention. We will need to rename the option accordingly.
We need this option for ThinLTO (though not distributed ThinLTO). During a ThinLTO build, LD is called directly when building vmlinux.o, so the Clang driver change will not apply in this case.
Please note that I am currently on vacation and may be slow to respond.
Thanks,
-Rong
Quoted 28 lines · Nathan Chancellor
Hi Rong and Han,
LLVM recently landed a commit renaming the '-split-machine-functions' plugin option to '-function-splitting=all':
https://github.com/llvm/llvm-project/commit/3e6acc87c58843e551d6e8e4bf06c26712b04622
This breaks builds with
CONFIG_AUTOFDOandCONFIG_LTO_CLANG_THINwith:ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument '-split-machine-functions'. Try: 'ld.lld --help'Obviously, we can handle this rename but I noticed that the combination of '-flto -fsplit-machine-functions' should add the corresponding '-plugin-opt=' since LLVM 15:
https://github.com/llvm/llvm-project/commit/72acd042bad35f78232f17addc02196a7af1a6e9
So is this even necessary? Should we just remove
KBUILD_LDFLAGS+= -plugin-opt=-split-machine-functionsfrom
scripts/Makefile.autofdoand rely on '-fsplit-machine-functions' to do the right thing or am I missing something here?--
Cheers,
Nathan
Hi Nathan,
Thanks for bringing this to our attention. We will need to rename the option accordingly.
We need this option for ThinLTO (though not distributed ThinLTO). During a ThinLTO build, LD is called directly when building vmlinux.o, so the Clang driver change will not apply in this case.
Please note that I am currently on vacation and may be slow to respond.
-Rong
Quoted 43 lines · Rong Xu
Hi Nathan,
Thanks for bringing this to our attention. We will need to rename the option accordingly.
We need this option for ThinLTO (though not distributed ThinLTO). During a ThinLTO build, LD is called directly when building vmlinux.o, so the Clang driver change will not apply in this case.
Please note that I am currently on vacation and may be slow to respond.
Thanks,
-Rong
Quoted 28 lines · Nathan Chancellor
Hi Rong and Han,
LLVM recently landed a commit renaming the '-split-machine-functions' plugin option to '-function-splitting=all':
https://github.com/llvm/llvm-project/commit/3e6acc87c58843e551d6e8e4bf06c26712b04622
This breaks builds with
CONFIG_AUTOFDOandCONFIG_LTO_CLANG_THINwith:ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument '-split-machine-functions'. Try: 'ld.lld --help'Obviously, we can handle this rename but I noticed that the combination of '-flto -fsplit-machine-functions' should add the corresponding '-plugin-opt=' since LLVM 15:
https://github.com/llvm/llvm-project/commit/72acd042bad35f78232f17addc02196a7af1a6e9
So is this even necessary? Should we just remove
KBUILD_LDFLAGS+= -plugin-opt=-split-machine-functionsfrom
scripts/Makefile.autofdoand rely on '-fsplit-machine-functions' to do the right thing or am I missing something here?--
Cheers,
Nathan