Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 833372 - media-gfx/openvdb-9.0.0: missing libatomic
Summary: media-gfx/openvdb-9.0.0: missing libatomic
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Adrian
URL: https://gitlab.kitware.com/cmake/cmak...
Whiteboard:
Keywords:
Depends on:
Blocks: libatomic-linking glibc-2.34
  Show dependency tree
 
Reported: 2022-02-15 03:05 UTC by Yixun Lan
Modified: 2022-02-19 03:59 UTC (History)
3 users (show)

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


Attachments
full build log (build.log.xz,6.66 KB, text/plain)
2022-02-15 03:07 UTC, Yixun Lan
Details
fix-atomic.patch (0001-openvdb-fix-missing-atomic-lib-issue.patch,1.48 KB, text/plain)
2022-02-16 14:29 UTC, Yixun Lan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yixun Lan archtester gentoo-dev 2022-02-15 03:05:37 UTC
/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1/../../../../riscv64-unknown-linux-gnu/bin/ld: openvdb/openvdb/cmd/CMakeFiles/vdb_render.dir/openvdb_render.cc.o: undefined reference to symbol '__atomic_exchange_1@@LIBATOMIC_1.0'
/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1/../../../../riscv64-unknown-linux-gnu/bin/ld: /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.1/libatomic.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Comment 1 Yixun Lan archtester gentoo-dev 2022-02-15 03:07:08 UTC
Created attachment 765143 [details]
full build log
Comment 2 Yixun Lan archtester gentoo-dev 2022-02-16 14:29:18 UTC
Created attachment 765265 [details]
fix-atomic.patch

for fixing this missing atomic library issue, we explicitly pass -pthread
to work around pthread builtin since glibc-2.34,
as we need -pthread to pull in libatomic for machines like riscv
Comment 3 Larry the Git Cow gentoo-dev 2022-02-18 22:23:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64988e18d34d6d84629194aa767ef29ed5521881

commit 64988e18d34d6d84629194aa767ef29ed5521881
Author:     Yixun Lan <dlan@gentoo.org>
AuthorDate: 2022-02-18 22:20:45 +0000
Commit:     Yixun Lan <dlan@gentoo.org>
CommitDate: 2022-02-18 22:20:45 +0000

    media-gfx/openvdb: fix missing atomic lib
    
    this happened on RISC-V platform, but may also
    exist in other ARCH, see tracking bug #721344
    
    Closes: https://bugs.gentoo.org/833372
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Yixun Lan <dlan@gentoo.org>

 .../openvdb/files/openvdb-9.0.0-fix-atomic.patch   | 47 ++++++++++++++++++++++
 media-gfx/openvdb/openvdb-9.0.0-r2.ebuild          |  1 +
 2 files changed, 48 insertions(+)
Comment 4 Alex Fan archtester 2022-02-19 03:48:17 UTC
As a note for this fix, the actual issue is cmake with glibc 2.34+. Since glibc 2.34, pthread is builtin and linking pthread is not required. CMake detects this and doesn't append -pthread. This is not correct behaviour because glibc never claims -pthread is unnecessary e.g. -pthread pulls in libatomic in riscv. Newer CMake version has fixed this and backported.