Control: tags -1 + moreinfo
isn't that something that should be done upstream for that architecture?
On 16.06.25 04:54, Jianfeng Liu wrote:
Package: libffi-dev
Version: 3.4.8-2
Severity: normal
Tags: patch
X-Debbugs-Cc: debian-loonga...@lists.debian.org
User: debian-loonga...@lists.debian.org
Usertags: loong64
Chromium is linking libffi staticly. While on LoongArch64 platform the
default code model
provides 256MiB PC-relative addressing space[1], which is not enough for
chromium.
I will get following errors like:
ld.lld-19: error: /lib/loongarch64-linux-gnu/libffi_pic.a(prep_cif.o):
(function ffi_prep_cif_core: .text+0x2b8): relocation R_LARCH_B26 out of
range: 157436696 is not in [-134217728, 134217727]; references 'abort'
After recompiling libffi with code model medium, chromium can get linked
fine.
Here is my patch setting medium code model:
diff --git a/debian/rules b/debian/rules
index 87e4467..7ad92a9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,6 +22,13 @@ CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
+# This will enable linking libffi staticly with large binaries like
chromium.
+# For more details, see:
+# https://github.com/loongson/la-abi-specs/blob/release/
laelf.adoc#code_models
+ifeq (loong64,$(DEB_HOST_ARCH))
+CFLAGS += -mcmodel=medium
+endif
+
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
with_check = yes
else