Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 864421 - media-tv/kodi-19.4-r2: undefined reference to `__atomic_exchange_1
Summary: media-tv/kodi-19.4-r2: 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: Craig Andrews
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks: libatomic-linking 866533
  Show dependency tree
 
Reported: 2022-08-08 13:27 UTC by Yixun Lan
Modified: 2022-08-26 14:38 UTC (History)
2 users (show)

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


Attachments
full build.log.xz (build.log.xz,85.18 KB, application/x-xz)
2022-08-08 13:30 UTC, Yixun Lan
Details
emerge --info (emerge_info.txt,6.86 KB, text/plain)
2022-08-08 13:31 UTC, Yixun Lan
Details
kodi-atomic.patch (kodi-atomic.patch,2.35 KB, patch)
2022-08-09 08:34 UTC, Yixun Lan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yixun Lan archtester gentoo-dev 2022-08-08 13:27:52 UTC
this actually due to lack 8/16bytes atomic instruction in RISC-V, I'll try to submit a patch for this

/usr/lib/gcc/riscv64-unknown-linux-gnu/12.1.1/../../../../riscv64-unknown-linux-gnu/bin/ld: build/utils/utils.a(Observer.cpp.o): in function `.L0 ':
Observer.cpp:(.text+0x296): undefined reference to `__atomic_exchange_1'
/usr/lib/gcc/riscv64-unknown-linux-gnu/12.1.1/../../../../riscv64-unknown-linux-gnu/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.


Reproducible: Always
Comment 1 Yixun Lan archtester gentoo-dev 2022-08-08 13:30:27 UTC
Created attachment 798877 [details]
full build.log.xz
Comment 2 Yixun Lan archtester gentoo-dev 2022-08-08 13:31:39 UTC
Created attachment 798880 [details]
emerge --info
Comment 3 Yixun Lan archtester gentoo-dev 2022-08-09 08:32:25 UTC
(In reply to Yixun Lan from comment #0)
> this actually due to lack 8/16bytes atomic instruction in RISC-V, I'll try
oops, a typo here! lacking 8/16bites (1/2 bytes) atomic instructions.
Comment 4 Yixun Lan archtester gentoo-dev 2022-08-09 08:34:38 UTC
Created attachment 798979 [details, diff]
kodi-atomic.patch

@candrews

can you give an ACK to this patch? I've tested on RISC-V and amd64 platform, it's actually pretty safe to apply to, and also verified at other project
Comment 5 matoro archtester 2022-08-09 16:20:39 UTC
FYI, I implemented append-atomic-flags in flag-o-matic.eclass in bug 820101, and I have it take an optional list of byte sizes.  So if you want to work around this  in the ebuild, you can use "append-atomic-flags 1 2".
Comment 6 Yixun Lan archtester gentoo-dev 2022-08-09 22:29:16 UTC
(In reply to matoro from comment #5)
> FYI, I implemented append-atomic-flags in flag-o-matic.eclass in bug 820101,
> and I have it take an optional list of byte sizes.  So if you want to work
> around this  in the ebuild, you can use "append-atomic-flags 1 2".

thanks, append-atomic-flags definitely could be another option

but, I'd aim to push an implementation to kodi upstream which developers would accept
Comment 7 Craig Andrews gentoo-dev 2022-08-10 01:20:23 UTC
> but, I'd aim to push an implementation to kodi upstream which developers
> would accept

+1

I'm happy to include a patch in the Gentoo ebuild, but not until upstream has accepted it.
Comment 8 Yixun Lan archtester gentoo-dev 2022-08-20 02:28:59 UTC
(In reply to Craig Andrews from comment #7)
> I'm happy to include a patch in the Gentoo ebuild, but not until upstream
> has accepted it.
hi @candrews
 I've sent the patch to upstream, but it's still in pending merge state,
do you mind we pushing the patch to portage tree first?

 I've tested it on riscv, amd64 machine, and work fine. also, I'm willing to continue working with upstream to get this patch accepted, so we can drop at next version bump..
Comment 9 Yixun Lan archtester gentoo-dev 2022-08-25 13:54:36 UTC
https://github.com/gentoo/gentoo/pull/27016

hi @candrews,
 could you take a look at this patch? and give an ACK? basically it's the same patch I've sent to upstream.
 also, I'd make it a timeout and commit myself in 5 days if no comments
 thanks
Comment 10 Larry the Git Cow gentoo-dev 2022-08-26 14:38:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7342318ebb39976b31c697e4cfe7221d348e5ed6

commit 7342318ebb39976b31c697e4cfe7221d348e5ed6
Author:     Yixun Lan <dlan@gentoo.org>
AuthorDate: 2022-08-25 13:36:16 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2022-08-26 14:38:09 +0000

    media-tv/kodi: fix missing atomic library issue
    
    Upstream: https://github.com/xbmc/xbmc/pull/21743
    Closes: https://bugs.gentoo.org/864421
    Signed-off-by: Yixun Lan <dlan@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/27016
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 media-tv/kodi/files/kodi-19.4-atomic.patch | 108 +++++++++++++++++++++++++++++
 media-tv/kodi/kodi-19.4-r2.ebuild          |   1 +
 2 files changed, 109 insertions(+)