[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a04cc3e2-d8d9-8ac4-d919-705babf4ccd8@loongson.cn>
Date: Tue, 23 Sep 2025 11:13:56 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Huacai Chen <chenhuacai@...nel.org>, Miguel Ojeda <ojeda@...nel.org>,
WANG Rui <wangrui@...ngson.cn>, rust-for-linux@...r.kernel.org,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v1 1/2] LoongArch: Make LTO case independent in Makefile
On 2025/9/23 上午9:10, Nathan Chancellor wrote:
>>>> ifdef CONFIG_LTO_CLANG
>>>> ifdef CONFIG_LLD_HAS_ANNOTATE_TABLEJUMP
>>>> KBUILD_LDFLAGS += -mllvm --loongarch-annotate-tablejump
>>>> else
>>>> KBUILD_LDFLAGS += -mllvm --no-jump-tables
>>>> endif
>
> There is no '--no-jump-tables' LLVM option so this will not work.
> Shouldn't -fno-jump-tables and -Zno-jump-tables take care of generating
> jump tables?
>
>> I do not know whether this is valid, you can test it with llvm 18
>> and llvm 20 if you think it is a proper way.
>
> For what it's worth, Huacai's original suggestion of
>
> KBUILD_LDFLAGS += $(call ld-option,-mllvm --loongarch-annotate-tablejump)
>
> appears to work for me and I do not see any objtool warnings with LTO
> enabled but I might be missing something.
As discussed offline, Huacai will test this change and submit a patch
later.
>> But IIRC, there is objtool warning with llvm 18, I reported to llvm
>> developer Wang Lei and he fixed it as the following commit:
>>
>> [LoongArch] Avoid indirect branch jumps using the ra register
>> https://github.com/llvm/llvm-project/commit/21ef17c62645
>>
>> Actually, the above commit solved a performance issue of llvm compiler,
>> so I prefer to update the minimal llvm version to 20 for LoongArch.
>
> I tend to let architecture maintainers make the call around minimum
> supported versions of compilers, so if that is how you would like to
> proceed, I am fine with that. I will say LLVM 20 is pretty new (released
> on March 4th, 2025) but I expect most of your users to probably be using
> bleeding edge tools for all the changes you make in the compiler and
> lower level libraries?
Usually, I like to use the latest LLVM upstream version to test the
kernel, but maybe somebody only uses the lower version, so keep the
minimal version as is.
Thanks,
Tiezhu
Powered by blists - more mailing lists