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_...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Sound Team
Depends on:
Blocks: libatomic-linking
  Show dependency tree
Reported: 2017-12-03 22:41 UTC by Rees Machtemes
Modified: 2020-05-07 01:23 UTC (History)
3 users (show)

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

build log (build.log,8.14 KB, application/octet-stream)
2017-12-03 22:41 UTC, Rees Machtemes
emerge --info (emerge_info,4.93 KB, text/plain)
2017-12-03 22:41 UTC, Rees Machtemes
emerge -pqv (emerge_pqv,229 bytes, text/plain)
2017-12-03 22:41 UTC, Rees Machtemes
hand edited Makefile (Makefile,8.35 KB, text/plain)
2017-12-03 22:42 UTC, Rees Machtemes
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 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 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.