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
Created attachment 769943 [details] build.log.xz
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
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(+)