Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 837740 - dev-libs/libfilezilla-0.36.0: undefined reference to __atomic_exchange_1
Summary: dev-libs/libfilezilla-0.36.0: undefined reference to __atomic_exchange_1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libatomic-linking 837743
  Show dependency tree
 
Reported: 2022-04-11 01:04 UTC by Yixun Lan
Modified: 2022-04-20 00:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,4.50 KB, application/x-xz)
2022-04-11 01:05 UTC, Yixun Lan
Details
libfilezilla-0.36.0-pthread.patch (libfilezilla-0.36.0-pthread.patch,296 bytes, application/octet-stream)
2022-04-11 01:20 UTC, Yixun Lan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yixun Lan archtester gentoo-dev 2022-04-11 01:04:43 UTC
problem here, there is no 1 and 2 bytes atomic instruction in RISC-V architecture,
so it's required to link to libatomic library.

===== error messages

libtool: link: riscv64-unknown-linux-gnu-g++ -std=c++17 -O2 -pipe -mabi=lp64d -Wall -g -Wl,-O1 -Wl,--as-needed -o timer_fizzbuzz timer_fizzbuzz-timer_fizzbuzz.o  ../lib/.libs/libfilezilla.so -lpthread -Wl,-rpath -Wl,/var/tmp/portage/dev-libs/libfilezilla-0.36.0/work/libfilezilla-0.36.0/lib/.libs
/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1/../../../../riscv64-unknown-linux-gnu/bin/ld: ../lib/.libs/libfilezilla.so: undefined reference to `__atomic_exchange_1'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:496: process] Error 1
make[1]: *** Waiting for unfinished jobs....
/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1/../../../../riscv64-unknown-linux-gnu/bin/ld: ../lib/.libs/libfilezilla.so: undefined reference to `__atomic_exchange_1'
/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1/../../../../riscv64-unknown-linux-gnu/bin/ld: ../lib/.libs/libfilezilla.so: undefined reference to `__atomic_exchange_1'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
Comment 1 Yixun Lan archtester gentoo-dev 2022-04-11 01:05:19 UTC
Created attachment 769943 [details]
build.log.xz
Comment 2 Yixun Lan archtester gentoo-dev 2022-04-11 01:20:23 UTC
Created attachment 769946 [details]
libfilezilla-0.36.0-pthread.patch


I'd like to propose the fix similar to the solution applied to dev-qt/qtcore [1],
which using "-pthread" instead of "-lpthread", as it will automatically expand to
include atomic library in RISC-V platform, which is pretty safe to adjust here
and will solve our problem.

if no objection, I will try to push this fix to our portage tree? and also report to upstream

[1] https://github.com/gentoo/gentoo/commit/3884552b6dd1bdeea1ca82bd23b6736c519ebe90
Comment 3 Larry the Git Cow gentoo-dev 2022-04-20 00:37:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5de5b893520423567e28dee634f082134670840e

commit 5de5b893520423567e28dee634f082134670840e
Author:     Yixun Lan <dlan@gentoo.org>
AuthorDate: 2022-04-20 00:20:52 +0000
Commit:     Yixun Lan <dlan@gentoo.org>
CommitDate: 2022-04-20 00:36:53 +0000

    dev-libs/libfilezilla: use -pthread to fix atomic issue
    
    the -pthread flag will expand link option "-latomic" in RISC-V platfrom,
    so will effectively fix the problem.
    
    Closes: https://bugs.gentoo.org/837740
    Upstream report: https://trac.filezilla-project.org/ticket/12699
    
    Signed-off-by: Yixun Lan <dlan@gentoo.org>

 .../libfilezilla/files/libfilezilla-0.37.1-pthread.patch    | 13 +++++++++++++
 dev-libs/libfilezilla/libfilezilla-0.37.1.ebuild            |  2 ++
 2 files changed, 15 insertions(+)