links with libelf.so.1 if devel/elfutils installed, but this is not reflected in deps list.
The openmp libraries for llvm < 16 pick up libelf if it's available. Also, all version pick up libffi when it's available.
*** Bug 273802 has been marked as a duplicate of this bug. ***
(In reply to Brooks Davis from comment #1) Why not remove these parts from "openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake" ?
(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
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
Created attachment 244917 [details] patch I found solution without additional patches for base sys or llvm sources.
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(-)
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(-)
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(-)
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(-)
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(-)
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(-)
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(-)
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(-)
What about libelf part?
(In reply to Ivan Rozhuk from comment #15) llvm16 and higher don't use libelf
(In reply to Brooks Davis from comment #16) 13 and 15 is used by me for build ff and as mesa dep.
(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.
(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.
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.
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(-)