Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* Build breakage from renamed '-split-machine-functions' plugin option
@ 2026-10-09 21:45 Nathan Chancellor
       [not found] ` <CAF1bQ=Qq66JuvYrbR-7GgegZuWPSjxDOgerUSD2NOp9W0BauZw@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2026-10-09 21:45 UTC (permalink / raw)
  To: Rong Xu, Han Shen; +Cc: llvm, linux-kbuild

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Build breakage from renamed '-split-machine-functions' plugin option
       [not found] ` <CAF1bQ=Qq66JuvYrbR-7GgegZuWPSjxDOgerUSD2NOp9W0BauZw@mail.gmail.com>
@ 2026-10-10 18:49   ` Rong Xu
  2026-10-10 18:50   ` Rong Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Rong Xu @ 2026-10-10 18:49 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Han Shen, llvm, linux-kbuild

Sorry that if you receive duplicated email.



Thanks,

-Rong


On Sat, Oct 10, 2026 at 8:46 PM Rong Xu <xur@google.com> wrote:
>
> 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
>
>
> On Fri, Oct 9, 2026 at 11:45 PM Nathan Chancellor <nathan@kernel.org> wrote:
>>
>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Build breakage from renamed '-split-machine-functions' plugin option
       [not found] ` <CAF1bQ=Qq66JuvYrbR-7GgegZuWPSjxDOgerUSD2NOp9W0BauZw@mail.gmail.com>
  2026-10-10 18:49   ` Rong Xu
@ 2026-10-10 18:50   ` Rong Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Rong Xu @ 2026-10-10 18:50 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Han Shen, llvm, linux-kbuild

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

On Sat, Oct 10, 2026 at 8:46 PM Rong Xu <xur@google.com> wrote:
>
> 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
>
>
> On Fri, Oct 9, 2026 at 11:45 PM Nathan Chancellor <nathan@kernel.org> wrote:
>>
>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-10 18:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 21:45 Build breakage from renamed '-split-machine-functions' plugin option Nathan Chancellor
     [not found] ` <CAF1bQ=Qq66JuvYrbR-7GgegZuWPSjxDOgerUSD2NOp9W0BauZw@mail.gmail.com>
2026-10-10 18:49   ` Rong Xu
2026-10-10 18:50   ` Rong Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox