Source: suitesparse-graphblas
Version: 7.4.0+dfsg-1
Severity: normal
Tags: patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the suitesparse-graphblas failed for loong64 in the Debian Package Auto-Building environment.
The error log is as follows,
```
......
[100%] Linking C shared library libgraphblas.so
/usr/bin/ld: CMakeFiles/graphblas.dir/Source/Generated2/GB_binop__div_fc32.c.o: relocation R_LARCH_B26 overflow 0xfffffffff7ffe73c
Dump relocate record:
stack top        relocation name        symbol
at CMakeFiles/graphblas.dir/Source/Generated2/GB_binop__div_fc32.c.o(.text+0xb80):
...
0x0000000000000000 R_LARCH_B26    `.L115'
......
```
The full build log can be found at https://buildd.debian.org/status/logs.php?pkg=suitesparse-graphblas&ver=7.4.0%2Bdfsg-1%2Bb1&arch=loong64.

Please consider the patch I attached (Add extra build cflags to fix relocation R_LARCH_B26 overflow). Based on attached patch, I have built suitesparse-graphblas_7.4.0+dfsg-1 successfully on locally.
```
......
    dh_builddeb
dpkg-deb: building package 'libgraphblas7-dbgsym' in '../libgraphblas7-dbgsym_7.4.0+dfsg-1_loong64.deb'. dpkg-deb: building package 'libgraphblas-doc' in '../libgraphblas-doc_7.4.0+dfsg-1_all.deb'. dpkg-deb: building package 'libgraphblas-dev' in '../libgraphblas-dev_7.4.0+dfsg-1_loong64.deb'. dpkg-deb: building package 'libgraphblas7' in '../libgraphblas7_7.4.0+dfsg-1_loong64.deb'.  dpkg-genbuildinfo --build=binary -O../suitesparse-graphblas_7.4.0+dfsg-1_loong64.buildinfo  dpkg-genchanges --build=binary -O../suitesparse-graphblas_7.4.0+dfsg-1_loong64.changes
```

Your opinions are welcome.

Best regards,
Dandan Zhang

--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,10 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 CFLAGS := $(CFLAGS) $(CPPFLAGS)
 
+ifneq (,$(filter $(DEB_BUILD_ARCH),loong64))
+CFLAGS := $(CFLAGS) $(CPPFLAGS) -mcmodel=medium
+endif
+
 # Flags for CMake
 export CMAKE_OPTIONS := -DCMAKE_INSTALL_PREFIX=/usr

Reply via email to