Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915833 - media-libs/libraw-0.20.1[openmp] clang profile: /usr/lib64/libraw.so.23: undefined symbol: __kmpc_global_thread_num
Summary: media-libs/libraw-0.20.1[openmp] clang profile: /usr/lib64/libraw.so.23: unde...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 881311 896220 915852
  Show dependency tree
 
Reported: 2023-10-15 21:29 UTC by Arniii
Modified: 2025-02-07 17:50 UTC (History)
3 users (show)

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


Attachments
startx -> dbus-launch --exit-with-session startplasma-wayland (file_915833.txt,3.88 KB, text/plain)
2023-10-15 21:29 UTC, Arniii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arniii 2023-10-15 21:29:24 UTC
Created attachment 872945 [details]
startx -> dbus-launch --exit-with-session startplasma-wayland

clang profile

attaching example of when it happens ( one example )

such errors seems to be found by tinderbox with another case.

after googling it seems to be a problem of linking against openmp runtime.

emerging with USE="-openmp" solves it, what proves the point above.

Also, it seems someone got the same with tinderbox : https://bugs.gentoo.org/408963#c8

maybe it's clang's openmp issue ?

anyway, link the issue somehow with clang-systemwide: https://bugs.gentoo.org/408963
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-24 08:16:23 UTC
(See bugs which depend on this too.)

I can't reproduce this yet but I guess the openmp flags aren't getting passed correctly when linking.

Their copy of AX_OPENMP in m4/openmp.m4 is kind of old so might be worth refreshing that from autoconf-archive.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-24 08:45:53 UTC
(In reply to Sam James from comment #1)
> [...]
> Their copy of AX_OPENMP in m4/openmp.m4 is kind of old so might be worth
> refreshing that from autoconf-archive.

Sent https://github.com/LibRaw/LibRaw/pull/633 upstream for this bit.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-24 08:49:52 UTC
Hm, with USE=openmp (no -fopenmp* in *FLAGS), my /usr/lib64/libraw_r.so.23.0.0 indeed isn't linked with libomp (or libgomp).
Comment 4 Koron Naga 2024-04-02 13:46:29 UTC
I encountered a similar problem when open the gwenview.

---
plasmashell[273640]: /usr/bin/gwenview: symbol lookup error: /usr/lib64/libraw.so.23: undefined symbol: __kmpc_global_thread_num
---

I solved it by adding "-lomp" to LDFLAGS and re-merging media-libs/libraw-0.21.2

---
LDFLAGS="${LDFLAGS} -lomp"
---

This seems to often happen when using OpenMP with CLANG.
Comment 5 Zhixu Liu 2025-02-02 08:42:45 UTC
> LDFLAGS="${LDFLAGS} -lomp"

I encountered the same problem today, success by reemerge with

LDFLAGS="-lomp" emerge -avgk media-tv/mythtv
Comment 6 Zhixu Liu 2025-02-02 11:00:01 UTC
(In reply to Zhixu Liu from comment #5)
> > LDFLAGS="${LDFLAGS} -lomp"
> 
> I encountered the same problem today, success by reemerge with
> 
> LDFLAGS="-lomp" emerge -avgk media-tv/mythtv

my case is during emerge, link failed. Use command above will put "-lomp" before any other options.

If remove "-Wl,--as-needed", link success.
Comment 7 Zhixu Liu 2025-02-03 07:30:18 UTC
> > > LDFLAGS="${LDFLAGS} -lomp"
> > 
> > I encountered the same problem today, success by reemerge with
> > 
> > LDFLAGS="-lomp" emerge -avgk media-tv/mythtv
> 
> my case is during emerge, link failed. Use command above will put "-lomp"
> before any other options.
> 
> If remove "-Wl,--as-needed", link success.

this stament is not 100% corret, if without "-Wl,--as-needed", build success with "-lomp" anywhere, but failed if "-lomp" is after "-Wl,--as-needed"
Comment 8 Larry the Git Cow gentoo-dev 2025-02-07 17:50:25 UTC
The bug has been closed via the following commit(s):

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

commit be1d7efe4b2d013134f2df4e7bb9922a4d85735e
Author:     Z. Liu <zhixu.liu@gmail.com>
AuthorDate: 2025-02-05 10:09:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-07 17:49:21 +0000

    media-libs/libraw: fix undefined symbol: __kmpc_xxx
    
    quick workaround, for same reason in media-libs/libsountch
    
    upstream fix should be handled in autotools, still working
    
    Closes: https://bugs.gentoo.org/881311
    Closes: https://bugs.gentoo.org/896220
    Closes: https://bugs.gentoo.org/915833
    Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/40444
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/libraw/libraw-0.21.1-r1.ebuild | 15 +++++++++++----
 media-libs/libraw/libraw-0.21.2.ebuild    | 15 +++++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)