Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 830286 - net-im/telegram-desktop-3.3.0: undefined reference to `__atomic_compare_exchange_1' in RISC-V
Summary: net-im/telegram-desktop-3.3.0: undefined reference to `__atomic_compare_excha...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Esteve Varela Colominas
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: libatomic-linking
  Show dependency tree
 
Reported: 2021-12-30 10:46 UTC by yongxiang
Modified: 2022-01-07 00:03 UTC (History)
2 users (show)

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


Attachments
telegram ebuild patch (telegram-ebuild.patch,3.39 KB, patch)
2021-12-30 11:03 UTC, yongxiang
Details | Diff
build.log (build.log,609.80 KB, application/octet-stream)
2021-12-30 11:15 UTC, yongxiang
Details
emerge --info (emerge-info.txt,5.05 KB, text/plain)
2021-12-30 12:45 UTC, yongxiang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yongxiang 2021-12-30 10:46:50 UTC
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
Comment 1 yongxiang 2021-12-30 10:48:50 UTC
(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
Comment 2 yongxiang 2021-12-30 10:51:17 UTC
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.
Comment 3 yongxiang 2021-12-30 11:03:14 UTC
Created attachment 760826 [details, diff]
telegram ebuild patch
Comment 4 yongxiang 2021-12-30 11:15:51 UTC
Created attachment 760828 [details]
build.log
Comment 5 Esteve Varela Colominas 2021-12-30 12:28:04 UTC
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.
Comment 6 yongxiang 2021-12-30 12:45:36 UTC
Created attachment 760829 [details]
emerge --info
Comment 7 Esteve Varela Colominas 2022-01-06 15:14:14 UTC
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.
Comment 8 yongxiang 2022-01-06 15:23:42 UTC
(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?
Comment 9 Esteve Varela Colominas 2022-01-06 21:58:50 UTC
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.
Comment 10 Larry the Git Cow gentoo-dev 2022-01-06 23:47:35 UTC
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(+)