Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639678 - media-sound/cmus-2.8.0_rc0 fails to merge on PPC, needs -latomic added to LD_FLAGS
Summary: media-sound/cmus-2.8.0_rc0 fails to merge on PPC, needs -latomic added to LD_...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libatomic-linking
  Show dependency tree
 
Reported: 2017-12-03 22:41 UTC by Rees Machtemes
Modified: 2021-04-28 10:20 UTC (History)
3 users (show)

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


Attachments
build log (build.log,8.14 KB, application/octet-stream)
2017-12-03 22:41 UTC, Rees Machtemes
Details
emerge --info (emerge_info,4.93 KB, text/plain)
2017-12-03 22:41 UTC, Rees Machtemes
Details
emerge -pqv (emerge_pqv,229 bytes, text/plain)
2017-12-03 22:41 UTC, Rees Machtemes
Details
hand edited Makefile (Makefile,8.35 KB, text/plain)
2017-12-03 22:42 UTC, Rees Machtemes
Details
User patch to add -latomic to LD_FLAGS (latomic.patch,554 bytes, patch)
2019-06-12 15:10 UTC, James Madgwick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(+)