[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 0/5] loongarch: add relaxation support
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v2 0/5] loongarch: add relaxation support |
Date: |
Mon, 12 Jun 2023 15:29:41 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Jun 12, 2023 at 04:20:41PM +0800, Xi Ruoyao via Grub-devel wrote:
> On Mon, 2023-06-12 at 14:54 +0800, WANG Xuerui wrote:
> > On 6/12/23 11:09, Xiaotian Wu wrote:
> > > 在 2023-06-12星期一的 06:35 +0800,Xi Ruoyao via Grub-devel写道:
> > > > On Wed, 2023-06-07 at 15:34 +0800, Xiaotian Wu wrote:
> > > > > Because the binutils of the loongarch architecture adds relaxation
> > > > > support [1], the next version of binutils will not be able to build
> > > > > grub.
> > > > >
> > > > > So we added the R_LARCH_B16, R_LARCH_B21 and R_LARCH_RELAX
> > > > > relocations
> > > > > to enhance grub compatibility.
> > > > Wouldn't it be easier to just pass -mno-relax to the toolchain when
> > > > we
> > > > build GRUB? I don't think it makes too much sense to perform
> > > > relaxation
> > > > on a boot loader. The boot loader is generally the coldest code
> > > > paths
> > > > in a system, so relaxing it won't give any real benefit (well, if you
> > > > reboot a system 100 times you may finally save one second), but
> > > > increases the maintenance burden.
> > > >
> > > Yes, it's easy to pass -mno-relax, but binutils-2.40 doesn't support
> > > this option.
> > Then maybe probe it in grub's configure and add it to CFLAGS when it's
> > supported? IIUC every toolchain with support for relaxation should
> > provide this toggle, and we already probe several LoongArch-specific
> > flags right now so the infra is already there.
>
> --no-relax is accepted even with ld-2.38, the man page says:
>
> On platforms where the feature is not supported, both --relax and
> --no-relax are accepted, but ignored.
>
> And it *should* disable relax for ld-2.41. If not I'd consider it a bug
> and we should fix it for Binutils.
>
> If --no-relax behaves as expected I guess we just need
>
> LDFLAGS_PLATFORM += -Wl,--no-relax
>
> in "if test "x$target_cpu" = xloongarch64" block.
It looks we have "no-relax" flag detection in the configure for sparc64
target. So, detection code is in place...
Anyway, I do not have very strong preference here because relaxation
code is not that big. So, we can carry it. Just please decide ASAP
which solution you prefer. I am going to do code freeze this week...
Daniel
- [PATCH v2 0/5] loongarch: add relaxation support, Xiaotian Wu, 2023/06/07
- [PATCH v2 1/5] Use the correct format specifier for formatted output, Xiaotian Wu, 2023/06/07
- [PATCH v2 3/5] loongarch: Rename function names, Xiaotian Wu, 2023/06/07
- [PATCH v2 4/5] loongarch: Add ELF relocation types documentation and comments, Xiaotian Wu, 2023/06/07
- [PATCH v2 2/5] loongarch: Optimize code using pc variable, Xiaotian Wu, 2023/06/07
- [PATCH v2 5/5] loongarch: Add relaxation support, Xiaotian Wu, 2023/06/07
- Re: [PATCH v2 0/5] loongarch: add relaxation support, Xi Ruoyao, 2023/06/11
Re: [PATCH v2 0/5] loongarch: add relaxation support, Xiaotian Wu, 2023/06/12
- Re: [PATCH v2 0/5] loongarch: add relaxation support, mengqinggang, 2023/06/13
- Re: [PATCH v2 0/5] loongarch: add relaxation support, WANG Xuerui, 2023/06/12
- Re: [PATCH v2 0/5] loongarch: add relaxation support, Xiaotian Wu, 2023/06/13
- Re: [PATCH v2 0/5] loongarch: add relaxation support, mengqinggang, 2023/06/13
- Re: [PATCH v2 0/5] loongarch: add relaxation support, Xiaotian Wu, 2023/06/13
- Re: [PATCH v2 0/5] loongarch: add relaxation support, Xiaotian Wu, 2023/06/13
- Re: [PATCH v2 0/5] loongarch: add relaxation support, mengqinggang, 2023/06/13
Re: [PATCH v2 0/5] loongarch: add relaxation support, Daniel Kiper, 2023/06/12