Bug 280957 - lang/clover: Remove llvm:max=16 restriction
Summary: lang/clover: Remove llvm:max=16 restriction
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-20 23:25 UTC by Jung-uk Kim
Modified: 2024-11-01 19:59 UTC (History)
3 users (show)

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


Attachments
Remove LLVM version restriction and fix LIB_DEPENDS syntax (729 bytes, patch)
2024-08-20 23:25 UTC, Jung-uk Kim
no flags Details | Diff
Remove LLVM version restriction (799 bytes, patch)
2024-08-22 19:33 UTC, Jung-uk Kim
no flags Details | Diff
Remove libLLVMSPIRVLib.so from LIB_DEPENDS (704 bytes, patch)
2024-11-01 19:54 UTC, Jung-uk Kim
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jung-uk Kim freebsd_committer freebsd_triage 2024-08-20 23:25:58 UTC
Created attachment 252966 [details]
Remove LLVM version restriction and fix LIB_DEPENDS syntax

The restriction was added in fa7309cb976e to fix Bug 275290:

https://cgit.freebsd.org/ports/commit/?id=fa7309cb976e3e73d59f271be3da01fee3006152

However, the latest devel/llvm17 does not seem to have this issue any more and devel/llvm18 works just fine.  FYI, devel/spirv-llvm-translator does not have llvm19 flavor yet.

Also, incorrect LIB_DEPENDS syntax is fixed.  Actually, devel/spirv-llvm-translator does not install libLLVMSPIRVLib.so.${LLVM_VERSION} in the first place.
Comment 1 Emmanuel Vadot freebsd_committer freebsd_triage 2024-08-21 05:49:43 UTC
If 17 and 18 works set the max to be 18 then.
Also devel/spirv-llvm-translator does install libLLVMSPIRVLib.so.${LLVM_VERSION} (at least for the 15 version)
Comment 2 Emmanuel Vadot freebsd_committer freebsd_triage 2024-08-21 05:50:10 UTC
Sorry misread the patch for the version, this part is fine.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2024-08-21 23:58:10 UTC
Comment on attachment 252966 [details]
Remove LLVM version restriction and fix LIB_DEPENDS syntax

> -		libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@${LLVM_PORT:T} \
> +		libLLVMSPIRVLib.so:devel/spirv-llvm-translator@${LLVM_PORT:T} \

When multiple ports provide the same library not specifying SOVERSION would introduce build conflict if an undesired version is installed. However, this port doesn't actually use spirv-llvm-translator because Intel GPU support is disabled (unlike in mesa-devel, runtime-gated via IRIS_ENABLE_CLOVER=1).

> does not install libLLVMSPIRVLib.so.${LLVM_VERSION} in the first place.

From devel/spirv-llvm-translator/Makefile

  SOVERSION=	${${FLAVOR:S/llvm//}<18:?${DISTVERSION:R:R}:${DISTVERSION:R}}

$ pkg info -xl spirv-llvm-translator | fgrep .so.
        /usr/local/llvm11/lib/libLLVMSPIRVLib.so.11
        /usr/local/llvm12/lib/libLLVMSPIRVLib.so.12
        /usr/local/llvm13/lib/libLLVMSPIRVLib.so.13
        /usr/local/llvm14/lib/libLLVMSPIRVLib.so.14
        /usr/local/llvm15/lib/libLLVMSPIRVLib.so.15
        /usr/local/llvm16/lib/libLLVMSPIRVLib.so.16
        /usr/local/llvm18/lib/libLLVMSPIRVLib.so.18.1

See also https://github.com/llvm/llvm-project/commit/91a384621e5b (spirv-llvm-translator uses add_llvm_tool() from AddLLVM.cmake)
Comment 4 Jung-uk Kim freebsd_committer freebsd_triage 2024-08-22 18:58:43 UTC
(In reply to Jan Beich from comment #3)
Yes, I get that.  However, it is not easy to find minor version number because LLVM_VERSION does not contain the information.

% make -V LLVM_DEFAULT
18
% make -V LLVM_VERSION
18
Comment 5 Jung-uk Kim freebsd_committer freebsd_triage 2024-08-22 19:33:12 UTC
Created attachment 253024 [details]
Remove LLVM version restriction

This patch works although it looks very hackish for my taste.  Note it only works because Mk/Scripts/find_lib.sh accepts glob patterns, probably not by design.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2024-08-22 22:16:03 UTC
(In reply to Jung-uk Kim from comment #4)
mesa-devel simply hardcodes 1 per OPENCL_SOVERSION=${LLVM_VERSION}${${LLVM_VERSION}>=18:?.1:}

So far 0 is development, 1 is stable while 2 or newer won't exist. devel/llvm18 (unlike lang/gcc13) only bumps patch-level version on stable minor/branch. 

IIRC, LLVM support cycle is 1 year for 2 major releases a year. Anything ABI breaking ends up being in a new major release. Rarely, LLVM breaks ABI on stable like in 7.1.0 and 11.1.0 but those never landed in ports and none cares anymore.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-08-27 16:32:07 UTC
A commit in branch main references this bug:

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

commit e4b79a0e4ebec69cb8e057e62d3dc994ace617e5
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2024-08-22 18:07:53 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2024-08-27 16:29:58 +0000

    lang/clover: Remove restriction on llvm version

    Clover can now be built with llvm > 16

    PR:             280957
    Sponsored by:   Beckhoff Automation GmbH & Co. KG

 lang/clover/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 8 Jung-uk Kim freebsd_committer freebsd_triage 2024-11-01 19:54:50 UTC
Created attachment 254855 [details]
Remove libLLVMSPIRVLib.so from LIB_DEPENDS

The commit did not fix libLLVMSPIRVLib.so issue.  In fact, I realized it is not necessary it at all.  This patch removes it from LIB_DEPENDS.
Comment 9 Jung-uk Kim freebsd_committer freebsd_triage 2024-11-01 19:59:59 UTC
We need to fix the LIB_DEPENDS issue with libLLVMSPIRVLib.so.