From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>,
Miguel Ojeda <ojeda@kernel.org>, WANG Rui <wangrui@loongson.cn>,
rust-for-linux@vger.kernel.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v1 1/2] LoongArch: Make LTO case independent in Makefile
Date: Tue, 23 Sep 2025 11:13:56 +0800 [thread overview]
Message-ID: <a04cc3e2-d8d9-8ac4-d919-705babf4ccd8@loongson.cn> (raw)
In-Reply-To: <20250923011057.GA3980504@ax162>
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
next prev parent reply other threads:[~2025-09-23 3:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 9:27 [PATCH v1 0/2] Fix objtool warnings with RUST on LoongArch Tiezhu Yang
2025-09-09 9:27 ` [PATCH v1 1/2] LoongArch: Make LTO case independent in Makefile Tiezhu Yang
2025-09-20 6:15 ` Nathan Chancellor
2025-09-20 8:23 ` Huacai Chen
2025-09-20 9:19 ` Tiezhu Yang
2025-09-20 10:22 ` Tiezhu Yang
2025-09-20 11:41 ` Huacai Chen
2025-09-20 12:52 ` Tiezhu Yang
2025-09-23 1:10 ` Nathan Chancellor
2025-09-23 3:13 ` Tiezhu Yang [this message]
2025-09-09 9:27 ` [PATCH v1 2/2] LoongArch: Handle jump tables option for RUST Tiezhu Yang
2025-09-09 10:16 ` Miguel Ojeda
2025-09-09 18:06 ` Matthew Maurer
2025-09-09 20:14 ` Miguel Ojeda
2025-09-18 9:15 ` [PATCH v1 0/2] Fix objtool warnings with RUST on LoongArch Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a04cc3e2-d8d9-8ac4-d919-705babf4ccd8@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=loongarch@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=wangrui@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®