Skip to contentSkip to conversation

Build breakage from renamed '-split-machine-functions' plugin option

DISCUSSION Nathan Chancellor 2 participants 3 messages Oct 9 – Oct 10 1 message not in the archive Kbuild

lore
Share & tools
lore

Nathan Chancellor

author maintainer
#0 lore raw

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_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

#2 lore raw

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_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?

--
Cheers,
Nathan

#3 lore raw
In reply to a message not in the archive

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_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?

--
Cheers,
Nathan