Control: tags -1 - patch

On 6/16/25 14:49, Jianfeng Liu wrote:
Hi,

On Mon, 16 Jun 2025 09:01:48 +0200, Matthias Klose wrote:
isn't that something that should be done upstream for that architecture?

There are three code models on loongarch64 according to its doc[1]:
- normal, the default one providing 256MiB PC-relative memory space.
- medium, providing 256GiB PC-relative memory space.
- extreme, providing full 64-bit memory space

And from the doc[1], wider addressing range requires more instructions and
brings higher overhead. The performance and size of an application can
benefit from a code model that does not overestimate the memory space
accessed by the code.  So I think the default normal model should be fine
for common use. If upstream compiler makes medium by default, that may harm
performance and size when the binary size is not that large like chromium.
So we have to decide which code model to use on each library. libffi is a
library which is set statically linked by chromium, so we have to build
libffi with medium code model.

if there are performance regressions, then you should not build the shared library with this option as well.

so the proper solution is to build the libffi_pic.a file from a second build on loong64.

please update the patch.

There is also libc++.a having similar issue[2] when linking chromium on
loong64, so I have created a MR[3] at llvm.

so, again the same regressions here, building everything with the medium model.

Reply via email to