I keyworded telegram-desktop and its dependencies. After "append-ldflags -pthread" in ebuild manually, it works fine. If I just add '-latomic', it reports an error: undefined reference to `__atomic_compare_exchange_1' I tried to report upstream (https://github.com/telegramdesktop/tdesktop/issues/17449), after adding 'append-ldflags -latomic' and -DCMAKE_LIBRARY_PATH=/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1 to rebuild, it also compiles successfully. I don't know if adding gcc's library path to CMAKE_LIBRARY_PATH in gentoo is a good idea. Reproducible: Always
(In reply to yongxiang from comment #0) > I keyworded telegram-desktop and its dependencies. > After "append-ldflags -pthread" in ebuild manually, it works fine. > > If I just add '-latomic', it reports an error: > undefined reference to `__atomic_compare_exchange_1' > > I tried to report upstream > (https://github.com/telegramdesktop/tdesktop/issues/17449), after adding > 'append-ldflags -latomic' and > -DCMAKE_LIBRARY_PATH=/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1 to > rebuild, it also compiles successfully. > > I don't know if adding gcc's library path to CMAKE_LIBRARY_PATH in gentoo is > a good idea. > > > > > Reproducible: Always s/to rebuild/to ebuild/ telegram-desktop version is 3.3.0
I also tried running one of the following, which also worked: LDFLAGS="-lpthread -latomic" emerge telegram-desktop LDFLAGS="-pthread" emerge telegram-desktop and both worked.
Created attachment 760826 [details, diff] telegram ebuild patch
Created attachment 760828 [details] build.log
Please publish your emerge --info and build logs at least. I'm wondering if it's related to a USE flag or your cflags are off wack. Also I'm currently gone for the week, I'll check it next week.
Created attachment 760829 [details] emerge --info
Alright, just read through this, thanks a lot for contacting upstream, as they'll fix this themselves in future versions. For now, if "append-ldflags '-pthread'" works, I'll just add that. Feel free to request a keyword for riscv on the relevant telegram-desktop version once the fix is applied, as the dependency tree is huge and I have no control of.
(In reply to Esteve Varela Colominas from comment #7) > Alright, just read through this, thanks a lot for contacting upstream, as > they'll fix this themselves in future versions. For now, if "append-ldflags > '-pthread'" works, I'll just add that. > > Feel free to request a keyword for riscv on the relevant telegram-desktop > version once the fix is applied, as the dependency tree is huge and I have > no control of. Yes. After "append-ldflags '-pthread'" now, it works in net-im/telegram-desktop-3.3.0. About adding the riscv keyword, is it after bump to 3.4.3? Or now?
I'd keyword it after the 3.4.3 bump, yeah. I've only added the fix in that one, as it makes little sense to test older versions on riscv. I wanted to stabilize 3.3.0 soon anyway.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d1ff465b1f870a6d2c1176643501dd3a6381927 commit 4d1ff465b1f870a6d2c1176643501dd3a6381927 Author: Esteve Varela Colominas <esteve.varela@gmail.com> AuthorDate: 2022-01-06 20:45:13 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-01-06 23:34:25 +0000 net-im/telegram-desktop: Bump to 3.4.3 Also fixing build for RISC-V, will need a separate ticket for keywording. PPC64 keyword dropped due to unkeyworded dependency. Closes: https://bugs.gentoo.org/830286 Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/23677 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> net-im/telegram-desktop/Manifest | 1 + .../telegram-desktop/telegram-desktop-3.4.3.ebuild | 154 +++++++++++++++++++++ 2 files changed, 155 insertions(+)