Bug 273801 - devel/llvm13: llvm1[012345] is missing a required shared library: libelf.so.1
Summary: devel/llvm13: llvm1[012345] is missing a required shared library: libelf.so.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Brooks Davis
URL:
Keywords:
: 273802 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-09-14 20:48 UTC by Ivan Rozhuk
Modified: 2023-09-23 08:10 UTC (History)
2 users (show)

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


Attachments
patch (1.04 KB, patch)
2023-09-16 05:37 UTC, Ivan Rozhuk
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2023-09-14 20:48:53 UTC
links with libelf.so.1 if devel/elfutils installed, but this is not reflected in deps list.
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2023-09-15 16:18:25 UTC
The openmp libraries for llvm < 16 pick up libelf if it's available.  Also, all version pick up libffi when it's available.
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2023-09-15 16:18:46 UTC
*** Bug 273802 has been marked as a duplicate of this bug. ***
Comment 3 Ivan Rozhuk 2023-09-15 21:05:20 UTC
(In reply to Brooks Davis from comment #1)
Why not remove these parts from "openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake" ?
Comment 4 Ivan Rozhuk 2023-09-16 00:50:22 UTC
(In reply to Brooks Davis from comment #1)
IMHO OPENMP is miss libffi as dep lib, here result of make package then libffi removed:

pkg-static: Unable to access file /tmp/ports/usr/ports/devel/llvm15/work-default/stage/usr/local/llvm15/lib/libomptarget.rtl.amdgpu.so:No such file or directory
pkg-static: Unable to access file /tmp/ports/usr/ports/devel/llvm15/work-default/stage/usr/local/llvm15/lib/libomptarget.rtl.amdgpu.so.15:No such file or directory
Comment 5 Ivan Rozhuk 2023-09-16 04:28:02 UTC
Upd: libelf is required dep, it also exist in base sys. It required for libomptarget.rtl.amdgpu.so and libomptarget.rtl.amdgpu.so.15, not libffi.

I add libelf.pc [1] for it, but fail to force use it.


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273839#c1
Comment 6 Ivan Rozhuk 2023-09-16 05:37:33 UTC
Created attachment 244917 [details]
patch

I found solution without additional patches for base sys or llvm sources.
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-09-19 17:21:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6e04d1ad587197ef60ae4ad365d03cfc80efae3e

commit 6e04d1ad587197ef60ae4ad365d03cfc80efae3e
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-19 17:15:55 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-19 17:20:26 +0000

    devel/llvm17: Welcome 17.0.1

    Welcome the first release of LLVM 17.  See the release announcement for
    more details: https://discourse.llvm.org/t/llvm-17-0-1-released/73549

    (Note that 17.0.0 was tagged, but contained an error so was not
    released.)

    Fix an issue where libffi would be linked if available by disabling it's
    use in OpenMP. [0]

    PR:             273801, 273947
    Submitted by:   Ivan Rozhuk <rozhuk.im@gmail.com> [0]

 devel/llvm17/Makefile  |  6 ++++--
 devel/llvm17/distinfo  |  6 +++---
 devel/llvm17/pkg-plist | 30 +++++++++++++++---------------
 3 files changed, 22 insertions(+), 20 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:43 UTC
A commit in branch main references this bug:

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

commit efe81450e1c4e4b029e104cf0bc49a80625c481a
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 10:45:11 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:34 +0000

    devel/llvm16: fix openmp library depends

    Don't link with libffi.

    Reformat long and/or multi-line OPTION_FOO variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm16/Makefile | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4e16eb4b2bf4fdd56ce9657203723e7adb4582c3

commit 4e16eb4b2bf4fdd56ce9657203723e7adb4582c3
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 11:06:18 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:35 +0000

    devel/llvm17: fix openmp library depends

    Don't link with libffi.

    Reformat long or multi-line OPTION_FOO variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm17/Makefile | 41 +++++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 18 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:48 UTC
A commit in branch main references this bug:

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

commit e75f65a524d6df56ebebb57fa9cff6ad23ba2593
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 10:38:30 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:33 +0000

    devel/llvm15: fix openmp library depends

    Use base system libelf and don't link with libffi.

    Reformat multi-line OPTION_CMAKE_ON variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm15/Makefile | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:49 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=61ee2ce26f020481d3975d1f75796ae1a37beab8

commit 61ee2ce26f020481d3975d1f75796ae1a37beab8
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 15:20:28 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:31 +0000

    devel/llvm12: fix openmp library depends

    Use base system libelf and don't link with libffi.

    Reformat multi-line OPTION_CMAKE_ON variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm12/Makefile | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:51 UTC
A commit in branch main references this bug:

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

commit f9f9bb0e1871b0c08a3cb83c6157c7918748ec9b
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 10:30:04 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:32 +0000

    devel/llvm13: fix openmp library depends

    Use base system libelf and don't link with libffi.

    Reformat long and/or multi-line OPTION_FOO variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm13/Makefile | 41 +++++++++++++++++++++++++----------------
 1 file changed, 25 insertions(+), 16 deletions(-)
Comment 13 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:53 UTC
A commit in branch main references this bug:

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

commit c1fe5e63cc150ab1dab75d61fa7f3454d1dc321c
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 10:33:50 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:33 +0000

    devel/llvm14: fix openmp library depends

    Use base system libelf and don't link with libffi.

    Reformat long and/or multi-line OPTION_FOO variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm14/Makefile | 45 +++++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 18 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2023-09-21 15:29:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=784b096f01e8c65c3f5aaddadc4b9ed231354c76

commit 784b096f01e8c65c3f5aaddadc4b9ed231354c76
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-21 08:38:46 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-21 15:23:31 +0000

    devel/llvm11: fix openmp library depends

    Use base system libelf and don't link with libffi.

    Reformat long and/or multi-line OPTION_FOO variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm11/Makefile | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)
Comment 15 Ivan Rozhuk 2023-09-21 15:33:35 UTC
What about libelf part?
Comment 16 Brooks Davis freebsd_committer freebsd_triage 2023-09-21 15:38:55 UTC
(In reply to Ivan Rozhuk from comment #15)

llvm16 and higher don't use libelf
Comment 17 Ivan Rozhuk 2023-09-21 15:45:56 UTC
(In reply to Brooks Davis from comment #16)
13 and 15 is used by me for build ff and as mesa dep.
Comment 18 Brooks Davis freebsd_committer freebsd_triage 2023-09-21 16:38:57 UTC
(In reply to Ivan Rozhuk from comment #17)
I need more context here. I've switched everything (except llvm-devel) to not use libffi and those that use libelf to use the base system one. My patch differs from yours in that I only set the values for openmp builds.
Comment 19 Ivan Rozhuk 2023-09-21 16:52:33 UTC
(In reply to Brooks Davis from comment #18)
Sorry, I miss that 16+ does not require libelf patch and miss that I look into fitst 2-3 commits for 16+ llvm.
Comment 20 Brooks Davis freebsd_committer freebsd_triage 2023-09-22 07:38:18 UTC
Given that 2024Q3 will only be live for a little over a week I don't plan to merge these changes.  If that's a problem let me know and I'll see if I can find time.
Comment 21 commit-hook freebsd_committer freebsd_triage 2023-09-23 08:10:46 UTC
A commit in branch main references this bug:

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

commit b79d9546e0073437942f19383feb04bbd35ec9ef
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-09-22 07:40:53 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-09-23 08:09:54 +0000

    devel/llvm-devel: new snapshot, library depends

    Don't link openmp with libffi.

    Reformat long or multi-line OPTION_FOO variables.

    PR:             273801
    Co-authored-by: Ivan Rozhuk <rozhuk.im@gmail.com>

 devel/llvm-devel/Makefile                          |  4 +-
 devel/llvm-devel/Makefile.snapshot                 |  4 +-
 devel/llvm-devel/distinfo                          |  6 +-
 .../files/patch-clang_lib_Headers_CMakeLists.txt   | 18 ++++-
 devel/llvm-devel/pkg-plist                         | 88 +++++++++++++++++-----
 5 files changed, 94 insertions(+), 26 deletions(-)