Bug#1031526: link-grammar: FTBFS on riscv64 (test failure)
Source: link-grammar
Version: 5.12.0~dfsg-2
Severity: important
Tags: ftbfs patch
Justification: fails to build from source (but built successfully in the past)
User: debian-riscv@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: i@hack3r.moe, debian-riscv@lists.debian.org
Dear maintainer,
link-grammar failed to build on riscv64 due to not linking to libatomic during
test:
```
FAIL: tests.py
==================================================================
link-grammar 5.12.0: bindings/python-examples/test-suite.log
==================================================================
# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: tests
===========
Running by: /usr/bin/python3
Running ./tests.py in: /<<PKGBUILDDIR>>/bindings/python-examples
PYTHONPATH=./../python:../python:../python/.libs
srcdir=.
LINK_GRAMMAR_DATA=./../../data
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/bindings/python/linkgrammar.py", line 10, in <module>
import linkgrammar.clinkgrammar as clg
ModuleNotFoundError: No module named 'linkgrammar.clinkgrammar'; 'linkgrammar' is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/bindings/python-examples/./tests.py", line 24, in <module>
from linkgrammar import (Sentence, Linkage, ParseOptions, Link, Dictionary,
File "/<<PKGBUILDDIR>>/bindings/python/linkgrammar.py", line 13, in <module>
import clinkgrammar as clg
File "/<<PKGBUILDDIR>>/bindings/python/clinkgrammar.py", line 12, in <module>
import _clinkgrammar
ImportError: /<<PKGBUILDDIR>>/link-grammar/.libs/liblink-grammar.so.5: undefined symbol: __atomic_fetch_add_2
FAIL tests.py (exit status: 1)
```
Full buildd log: https://buildd.debian.org/status/fetch.php?pkg=link-grammar&arch=riscv64&ver=5.12.0%7Edfsg-2&stamp=1674569454&raw=0
This can be fixed by adding -latomic in d/rules, which is done using the
attached patch. If more help is needed, please let me know.
Cheers,
Eric
diff -Nru link-grammar-5.12.0~dfsg/debian/changelog link-grammar-5.12.0~dfsg/debian/changelog
--- link-grammar-5.12.0~dfsg/debian/changelog 2023-01-24 13:40:52.000000000 +0800
+++ link-grammar-5.12.0~dfsg/debian/changelog 2023-02-18 04:24:12.000000000 +0800
@@ -1,3 +1,10 @@
+link-grammar (5.12.0~dfsg-2.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix FTBFS on riscv64
+
+ -- Eric Long <i@hack3r.moe> Sat, 18 Feb 2023 04:24:12 +0800
+
link-grammar (5.12.0~dfsg-2) unstable; urgency=medium
* fix source helper tool copyright-check
diff -Nru link-grammar-5.12.0~dfsg/debian/rules link-grammar-5.12.0~dfsg/debian/rules
--- link-grammar-5.12.0~dfsg/debian/rules 2023-01-24 13:29:11.000000000 +0800
+++ link-grammar-5.12.0~dfsg/debian/rules 2023-02-18 04:24:12.000000000 +0800
@@ -14,6 +14,11 @@
export DEB_CXXFLAGS_MAINT_APPEND=-O3
endif
+ifeq ($(DEB_HOST_ARCH),riscv64)
+DEB_CFLAGS_MAINT_APPEND+=-latomic
+DEB_CXXFLAGS_MAINT_APPEND+=-latomic
+endif
+
no_java_archs = hppa hurd-i386 kfreebsd-amd64 kfreebsd-i386 m68k sh4
ifneq (,$(filter $(DEB_HOST_ARCH), $(no_java_archs)))
CONFIGURE_ARGS += --disable-java-bindings
Reply to: