Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 803470 - dev-qt/qt3d-5.15.2: requires to link with -latomic (undefined reference to `__atomic_exchange_1')
Summary: dev-qt/qt3d-5.15.2: requires to link with -latomic (undefined reference to `_...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: libatomic-linking
  Show dependency tree
 
Reported: 2021-07-23 05:53 UTC by Alex Fan
Modified: 2022-04-01 18:23 UTC (History)
1 user (show)

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


Attachments
build log (qt3d-5.15.2:20210722-145741.log.gz,66.97 KB, application/gzip)
2021-07-23 05:58 UTC, Alex Fan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Fan archtester 2021-07-23 05:53:39 UTC
This happens to me on qemu riscv64 environment. It is very likely the same issue as Bug 790689. 

/usr/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: .obj/renderview.o: in function `.L2004':
renderview.cpp:(.text+0x4a96): undefined reference to `__atomic_exchange_1'
collect2: error: ld returned 1 exit status
distcc[2081528] ERROR: compile (null) on localhost failed
make[3]: *** [Makefile:234: ../../../../plugins/renderers/libopenglrenderer.so] Error 1
make[3]: Leaving directory '/var/tmp/portage/dev-qt/qt3d-5.15.2/work/qt3d-everywhere-src-5.15.2_build/src/plugins/renderers/opengl'
make[2]: *** [Makefile:47: sub-opengl-make_first] Error 2
make[2]: Leaving directory '/var/tmp/portage/dev-qt/qt3d-5.15.2/work/qt3d-everywhere-src-5.15.2_build/src/plugins/renderers'
make[1]: *** [Makefile:171: sub-plugins-renderers-make_first] Error 2
make[1]: *** Waiting for unfinished jobs....
Comment 1 Alex Fan archtester 2021-07-23 05:58:21 UTC
Created attachment 725956 [details]
build log

compressed due to exceeding size limit, please use zcat to view it.
Comment 2 Yixun Lan archtester gentoo-dev 2022-03-22 01:49:29 UTC
# Use link option -pthread instead of -lpthread

# https://github.com/riscv-collab/riscv-gcc/issues/12 use Option 4
# https://stackoverflow.com/questions/23250863/difference-between-pthread-and-lpthread-while-compiling
# In riscv, "-pthread" equivalent to add link option "--push-state --as-needed -latomic --pop-state"

according to last version of the patch, the "-pthread" option sounds as a better solution, can we accept and push this?
Comment 3 Yixun Lan archtester gentoo-dev 2022-03-22 01:51:20 UTC
(In reply to Yixun Lan from comment #2)
> # Use link option -pthread instead of -lpthread
> 
> # https://github.com/riscv-collab/riscv-gcc/issues/12 use Option 4
> #
> https://stackoverflow.com/questions/23250863/difference-between-pthread-and-
> lpthread-while-compiling
> # In riscv, "-pthread" equivalent to add link option "--push-state
> --as-needed -latomic --pop-state"
> 
> according to last version of the patch, the "-pthread" option sounds as a
> better solution, can we accept and push this?

actually, the patch need to apply to qtcore, so which mean we don't need patch for qt3d anymore
Comment 4 Larry the Git Cow gentoo-dev 2022-03-30 18:57:35 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3884552b6dd1bdeea1ca82bd23b6736c519ebe90

commit 3884552b6dd1bdeea1ca82bd23b6736c519ebe90
Author:     Han Gao <rabenda.cn@gmail.com>
AuthorDate: 2022-03-27 13:05:18 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2022-03-30 18:56:21 +0000

    dev-qt/qtcore: use link option -pthread instead of -lpthread
    
    Bug: https://bugs.gentoo.org/803470
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Han Gao <rabenda.cn@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/24711
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch | 41 +++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.3.ebuild              |  4 +++
 2 files changed, 45 insertions(+)
Comment 5 Yixun Lan archtester gentoo-dev 2022-03-30 22:03:22 UTC
with this patch pushed, we can close this bug, thanks all!

also, dev-qt/qt3d riscv keywording is done
Comment 6 Larry the Git Cow gentoo-dev 2022-04-01 18:23:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=ebcfd362f1047bbb7c09021bad242dc9fd8a030f

commit ebcfd362f1047bbb7c09021bad242dc9fd8a030f
Author:     Han Gao <rabenda.cn@gmail.com>
AuthorDate: 2022-03-27 13:05:18 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2022-04-01 17:57:49 +0000

    dev-qt/qtcore: use link option -pthread instead of -lpthread
    
    Bug: https://bugs.gentoo.org/803470
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Han Gao <rabenda.cn@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/24711
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch | 41 +++++++++++++++++++++++++
 dev-qt/qtcore/qtcore-5.15.3.9999.ebuild         |  1 +
 2 files changed, 42 insertions(+)