Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 639678

Summary: media-sound/cmus-2.8.0_rc0 fails to merge on PPC, needs -latomic added to LD_FLAGS
Product: Gentoo Linux Reporter: Rees Machtemes <reeskm>
Component: Current packagesAssignee: Gentoo Sound Team <sound>
Status: RESOLVED FIXED    
Severity: normal CC: james, jstein, reeskm
Priority: Normal    
Version: unspecified   
Hardware: PPC   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 721344    
Attachments: build log
emerge --info
emerge -pqv
hand edited Makefile
User patch to add -latomic to LD_FLAGS

Description Rees Machtemes 2017-12-03 22:41:08 UTC
Created attachment 507958 [details]
build log

On my gentoo PPC box I tried building media-sound/cmus-2.8.0_rc0 and it failed when linking due to:
track_info.c(.text+0x34): undefined reference to `__atomic_fetch_add_8`

build.log attached, along with emerge --info.

It needs "-latomic" appended to CMUS_LIBS in the Makefile. This is probably necessary for any arch (like PPC64, ARM) also.

I was able to get it to successfully build by hand editing the Makefile and:

ebuild /usr/portage/media-sound/cmus/cmus-2.8.0_rc0.ebuild compile install qmerge

I don't know how to properly edit the ebuild to do this, but we would probably be able to conditionally pass it to ./configure line in src_configure() based on the ARCH.

I would appreciate learning how to do this properly, so I could contribute an ebuild to the bug report next time ;)
Comment 1 Rees Machtemes 2017-12-03 22:41:37 UTC
Created attachment 507960 [details]
emerge --info
Comment 2 Rees Machtemes 2017-12-03 22:41:54 UTC
Created attachment 507962 [details]
emerge -pqv
Comment 3 Rees Machtemes 2017-12-03 22:42:24 UTC
Created attachment 507964 [details]
hand edited Makefile
Comment 4 ernsteiswuerfel archtester 2018-08-06 15:04:49 UTC
Did run into this on ppc too. A patch would be nice.
Comment 5 James Madgwick 2019-06-12 15:10:31 UTC
Created attachment 579634 [details, diff]
User patch to add -latomic to LD_FLAGS

This bug also affects me on an antique x86 arch. I presume using march=i486 in make.conf is why, although this arch is supposed to support atomics. My solution was to hand edit the Makefile and create a diff patch, which is then automatically applied (when running emerge normally) by placing it into /etc/portage/patches/media-sound/cmus/.
Comment 6 ernsteiswuerfel archtester 2019-06-15 12:53:30 UTC
(In reply to James Madgwick from comment #5)
> Created attachment 579634 [details, diff] [details, diff]
> User patch to add -latomic to LD_FLAGS
Thanks! Your patch works for me perfectly on ppc too.
Comment 7 Larry the Git Cow gentoo-dev 2021-04-28 10:20:55 UTC
The bug has been closed via the following commit(s):

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

commit 5b0a7da41f1215f191edc2e2519941e43f03e89f
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2021-04-28 10:20:40 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2021-04-28 10:20:40 +0000

    media-sound/cmus: fixed building of 2.9.1 on ppc
    
    thanks to James Madgwick <james@madgwick.xyz> for the patch
    
    Closes: https://bugs.gentoo.org/639678
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 media-sound/cmus/cmus-2.9.1.ebuild             |  4 ++++
 media-sound/cmus/files/cmus-2.9.1-atomic.patch | 11 +++++++++++
 2 files changed, 15 insertions(+)