Bug 259904 - graphics/libraw: needs to link with libomp when built with OPTION OPENMP
Summary: graphics/libraw: needs to link with libomp when built with OPTION OPENMP
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Christoph Moench-Tegeder
URL:
Keywords: easy, patch, patch-ready
Depends on:
Blocks:
 
Reported: 2021-11-17 22:02 UTC by Christoph Moench-Tegeder
Modified: 2021-12-10 20:42 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (jhale)


Attachments
link against libomp on OPENMP=on (613 bytes, patch)
2021-11-17 22:02 UTC, Christoph Moench-Tegeder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Moench-Tegeder freebsd_committer 2021-11-17 22:02:15 UTC
Created attachment 229561 [details]
link against libomp on OPENMP=on

after07fb2d5e9d00 and 54cc4cc6eaed14e3d495ca3a3b6f86f3f429b991 , shotwell fails on libraw if libraw is built with OPENMP=on:
  ld-elf.so.1: /usr/local/lib/libraw.so.20: Undefined symbol "__kmpc_fork_call"
(this can be observed on any operation on RAW files - viewing preprocessed files or importing JPEGs seems to be ok in any case).

This can be fixed by adding -lomp to libraw's LDFLAGS (OPENMP_LDFLAGS), as per the attached patch. "works for me and poudriere" (that bumps libraw's PORTREVISION). (yes, adding -lomp to shotwell does not help).
Comment 1 Daniel Engberg freebsd_committer 2021-11-17 23:29:26 UTC
...and perhaps make it default on aarch64 and amd64?
Comment 2 commit-hook freebsd_committer 2021-12-10 20:33:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=24e4736c1314c59bedcba20bdb2e20e571e5b650

commit 24e4736c1314c59bedcba20bdb2e20e571e5b650
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2021-12-10 20:30:10 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2021-12-10 20:32:20 +0000

    graphics/libraw: link against libomp with OPENMP=on

    Since 07fb2d5e9d00 consumers - most notably shotwell - crashed hard
    on RAW file operations when libraw was built with OPENMP=on:
      ld-elf.so.1: /usr/local/lib/libraw.so.20: Undefined symbol "__kmpc_fork_call"

    adding -lomp to libraw's LDFLAGS (via OPENMP_LDFLAGS, so it stays
    conditional) fixes the issue.

    PR:             259904
    Approved by:    maintainer-timeout (jhale@)

 graphics/libraw/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 3 Christoph Moench-Tegeder freebsd_committer 2021-12-10 20:42:17 UTC
I'm totally for setting OPENMP=on as default (where appropriate), but I'd rather push feature changes to other people's ports on a just-a-little-fix-PR and under maintainer-timeout.

So, for now only make sure that OPENMP is actually usable. Committed.