'; }
Bug 295111 - devel/spirv-llvm-translator: LLVMMipsCodeGen references the file libLLVMMipsCodeGen.a
Summary: devel/spirv-llvm-translator: LLVMMipsCodeGen references the file libLLVMMipsC...
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: https://pkg-status.freebsd.org/beefy2...
Keywords:
: 295121 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-05-08 20:58 UTC by John Kennedy
Modified: 2026-06-21 23:45 UTC (History)
10 users (show)

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


Attachments
/usr/local/poudriere/data/logs/bulk/latest-per-pkg/spirv-llvm-translator-llvm19/19.1.18/15-master.log (16.81 KB, text/plain)
2026-05-08 20:58 UTC, John Kennedy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Kennedy 2026-05-08 20:58:41 UTC
Created attachment 270525 [details]
/usr/local/poudriere/data/logs/bulk/latest-per-pkg/spirv-llvm-translator-llvm19/19.1.18/15-master.log

When I'm trying to poudriere-build devel/spirv-llvm-translator as a dependency, I'm seeing this error:

...
CMake Error at /usr/local/llvm19/lib/cmake/llvm/LLVMExports.cmake:1728 (message):
  The imported target "LLVMMipsCodeGen" references the file

     "/usr/local/llvm19/lib/libLLVMMipsCodeGen.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/local/llvm19/lib/cmake/llvm/LLVMExports.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/local/llvm19/lib/cmake/llvm/LLVMConfig.cmake:348 (include)
  CMakeLists.txt:82 (find_package)


-- Configuring incomplete, errors occurred!
*** Error code 1

This is on a 15.1-BETA2 x86-64 system, not that I think that this is particular to that.  This is from the "main" branch of the anongit@git.FreeBSD.org:ports.git (currently at 13-eol-396-gdcfcb1be64b3 / dcfcb1be64b3700717da7fd82e69e6cb1514db11).
Comment 1 Mark Millard 2026-05-08 21:41:01 UTC
(In reply to John Kennedy from comment #0)

The way I read that messaging, the files with some reference
to LLVMMipsCodeGen and such are in the likes of:

/usr/local/llvm*/lib/cmake/llvm/LLVMExports.cmake

It looks to me like the files in the various:

/usr/local/llvm*/lib/cmake/

directories should not be referencing Mips for
FreeBSD OS contexts that no longer support Mips.


For example:

# grep -rl Mips /usr/local/llvm22/lib/cmake/llvm/
/usr/local/llvm22/lib/cmake/llvm/LLVMExports.cmake
/usr/local/llvm22/lib/cmake/llvm/HandleLLVMOptions.cmake
/usr/local/llvm22/lib/cmake/llvm/LLVMExports-release.cmake
/usr/local/llvm22/lib/cmake/llvm/LLVMConfig.cmake

# grep -rl LLVMMipsCodeGen /usr/local/llvm22/lib/cmake/llvm/
/usr/local/llvm22/lib/cmake/llvm/LLVMExports.cmake
/usr/local/llvm22/lib/cmake/llvm/LLVMExports-release.cmake
/usr/local/llvm22/lib/cmake/llvm/LLVMConfig.cmake


Where the likes of (as an example):

/usr/local/llvm22/lib/cmake/llvm/LLVMExports.cmake

has:

 # Create imported target LLVMMipsCodeGen
add_library(LLVMMipsCodeGen STATIC IMPORTED)

set_target_properties(LLVMMipsCodeGen PROPERTIES
  INTERFACE_LINK_LIBRARIES "LLVMAnalysis;LLVMAsmPrinter;LLVMCodeGen;LLVMCodeGenTypes;LLVMCore;LLVMGlobalISel;LLVMMC;LLVMMipsDesc;LLVMMipsInfo;LLVMSelectionDAG;LLVMSupport;LLVMTarget;LLVMTargetParser;L
LVMTransformUtils"
)

# Create imported target LLVMMipsAsmParser
add_library(LLVMMipsAsmParser STATIC IMPORTED)
 
set_target_properties(LLVMMipsAsmParser PROPERTIES
  INTERFACE_LINK_LIBRARIES "LLVMMC;LLVMMCParser;LLVMMipsDesc;LLVMMipsInfo;LLVMSupport;LLVMTargetParser"
)

# Create imported target LLVMMipsDisassembler
add_library(LLVMMipsDisassembler STATIC IMPORTED)
    
set_target_properties(LLVMMipsDisassembler PROPERTIES
  INTERFACE_LINK_LIBRARIES "LLVMMCDisassembler;LLVMMC;LLVMMipsInfo;LLVMSupport"
)

# Create imported target LLVMMipsDesc
add_library(LLVMMipsDesc STATIC IMPORTED)
  
set_target_properties(LLVMMipsDesc PROPERTIES
  INTERFACE_LINK_LIBRARIES "LLVMCodeGenTypes;LLVMMC;LLVMMipsInfo;LLVMSupport;LLVMTargetParser"
)
  
# Create imported target LLVMMipsInfo
add_library(LLVMMipsInfo STATIC IMPORTED)

set_target_properties(LLVMMipsInfo PROPERTIES
  INTERFACE_LINK_LIBRARIES "LLVMMC;LLVMSupport"
)
Comment 2 Jan Beich freebsd_committerfreebsd_triage 2026-05-08 23:58:51 UTC
pkg-fallout@ is silent. If /usr/local/llvm*/lib/cmake reference non-existent files it's not a problem with this port. Over to devel/llvm19 maintainer to investigate.
Comment 3 John Kennedy 2026-05-09 00:23:20 UTC
Its going to take forever to testport, but it looks like llvm19 probably dropped it ~2a7c0561200c6cf9d0c0252cd4a7ab446eca8e4a ("all: drop support for FreeBSD 13, mips and risc64sf"):

git diff -u 52e12ad06a5e3cb6b7d374c00910b902db91b9cd 2a7c0561200c6cf9d0c0252cd4a7ab446eca8e4a /usr/ports/devel/llvm19

-_FREEBSD_BACKENDS=     AArch64 ARM Mips PowerPC RISCV Sparc X86
+_FREEBSD_BACKENDS=     AArch64 ARM PowerPC RISCV Sparc X86

(plus a little more)

I think LLVMExports.cmake is generated based on it's comments, so not sure if some more tweaking needs to happen to exclude Mips from more places.

[Jonathan Chen mentioned that guess in this email to freebsd-ports]

That's about the right timeframe for me to notice it, it just happened to be when BETA2 triggered a full rebuild of everything.
Comment 4 Mark Millard 2026-05-09 00:31:31 UTC
(In reply to Jan Beich from comment #2)

The FreeBSD-13, mips, risc64sf removal was:

committer	Rene Ladan <rene@FreeBSD.org>	2026-05-07 21:47:29 +0000

No new port package builders runs have started since then:
the ports snapshots in process all predate the change.

Eventually I expect the issue would show up.
Comment 5 Mark Millard 2026-05-09 00:56:54 UTC
I'll note that:

STANDARD_BACKENDS=	${_FREEBSD_BACKENDS} AMDGPU AVR BPF Hexagon Lanai \
			LoongArch MSP430 NVPTX SPIRV SystemZ VE WebAssembly \
			XCore

will no longer include Mips . But:

BE_FREEBSD_DESC=	Backends for FreeBSD architectures
BE_FREEBSD_CMAKE_ON=	-DLLVM_TARGETS_TO_BUILD="${FREEBSD_BACKENDS:ts;}"
BE_NATIVE_DESC=		Backend(s) for this architecture (${_NATIVE_BACKENDS})
BE_NATIVE_CMAKE_ON=	-DLLVM_TARGETS_TO_BUILD="${NATIVE_BACKENDS:ts;}"
BE_STANDARD_DESC=	All non-experimental backends

does not have a:

BE_STANDARD_CMAKE_ON= -DLLVM_TARGETS_TO_BUILD="${STANDARD_BACKENDS:ts;}"

there are only the 2 instances of LLVM_TARGETS_TO_BUILD text
in the Makefile example that I'm looking at (llvm22's).
Comment 6 Jan Beich freebsd_committerfreebsd_triage 2026-05-09 15:09:24 UTC
*** Bug 295121 has been marked as a duplicate of this bug. ***
Comment 7 Mark Millard 2026-05-09 15:23:15 UTC
(In reply to Mark Millard from comment #5)

STANDARD_BACKENDS described as: "All non-experimental backends"

But is the experimental status as defined upstream? As
defined for the FreeBSD OS use? The description should
likely be explicit about that context specification.

My guess is upstream non-experimental was intended
--allowing for targeting things that are not running
FreeBSD.

If I guessed right, Mips would then be approriate to
explicitly add to STANDARD_BACKENDS.
Comment 8 Dimitry Andric freebsd_committerfreebsd_triage 2026-05-10 22:39:56 UTC
This indeed has something to do with ports 2a7c0561200c6cf9d0c0252cd4a7ab446eca8e4a, as this removed the MIPS backend from the various devel/llvm ports (note the port revisions were not bumped).

For some reason, it still builds the LLVMMipsCodeGen library, at least on my poudriere box, and it doesn't install it, and then CMake complains.

I think this should maybe be reported as a devel/llvm bug?
Comment 9 Dimitry Andric freebsd_committerfreebsd_triage 2026-05-10 22:49:05 UTC
(In reply to Dimitry Andric from comment #8)

I need to go to sleep now, but if somebody would like to try the following patch for devel/llvm19:

diff --git a/devel/llvm19/Makefile b/devel/llvm19/Makefile
index 554951f5e80a..c4bd2323a01e 100644
--- a/devel/llvm19/Makefile
+++ b/devel/llvm19/Makefile
@@ -132,6 +132,7 @@ BE_FREEBSD_CMAKE_ON=        -DLLVM_TARGETS_TO_BUILD="${FREEBSD_BACKENDS:ts;}"
 BE_NATIVE_DESC=                Backend(s) for this architecture (${_NATIVE_BACKENDS})
 BE_NATIVE_CMAKE_ON=    -DLLVM_TARGETS_TO_BUILD="${NATIVE_BACKENDS:ts;}"
 BE_STANDARD_DESC=      All non-experimental backends
+BE_STANDARD_CMAKE_ON=  -DLLVM_TARGETS_TO_BUILD="${STANDARD_BACKENDS:ts;}"
 BE_WASM_DESC=          WebAssembly backend (required by firefox via wasi)
 .for BE in FREEBSD NATIVE STANDARD
 BE_${BE}_PLIST_FILES= \
Comment 10 John Kennedy 2026-05-10 23:46:44 UTC
(In reply to Dimitry Andric from comment #9)
I'll test that now.  I know reverting the previous patch works.
Comment 11 Alastair Hogge 2026-05-11 06:51:25 UTC
(In reply to Dimitry Andric from comment #9)
> +BE_STANDARD_CMAKE_ON=  -DLLVM_TARGETS_TO_BUILD="${STANDARD_BACKENDS:ts;}"
Unfortunately, this does not progress the build.
Comment 12 Brooks Davis freebsd_committerfreebsd_triage 2026-05-11 08:09:52 UTC
I see the problem. STANDARD_BACKENDS is now missing Mips because STANDARD_BACKENDS is ${FREEBSD_BACKENDS} plus whatever else LLVM builds by default.  I forgotten that I'd constructed it that what many years ago and that Mips needs to be adde back to STANDARD_BACKENDS. I'll do that shortly.
Comment 13 commit-hook freebsd_committerfreebsd_triage 2026-05-11 09:30:16 UTC
A commit in branch main references this bug:

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

commit 4fc6c5e1c9a43149a91c626c56ae6e33066449bc
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2026-05-11 09:24:23 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2026-05-11 09:29:31 +0000

    devel/llvm??: Add Mips back to standard backends

    I'd forgotten that STANDARD_BACKENDS is includes _FREEBSD_BACKENDS so
    Mips dropped out of the list when it was removed from _FREEBSD_BACKENDS.

    PR:             295111
    Fixes:          2a7c0561200c ("all: drop support for FreeBSD 13, mips and risc64sf")

 devel/llvm12/Makefile | 2 +-
 devel/llvm13/Makefile | 2 +-
 devel/llvm14/Makefile | 2 +-
 devel/llvm15/Makefile | 2 +-
 devel/llvm16/Makefile | 2 +-
 devel/llvm17/Makefile | 2 +-
 devel/llvm18/Makefile | 2 +-
 devel/llvm19/Makefile | 2 +-
 devel/llvm20/Makefile | 2 +-
 devel/llvm21/Makefile | 2 +-
 devel/llvm22/Makefile | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)
Comment 14 Alastair Hogge 2026-05-11 10:26:30 UTC
That appears to have fixed it, thanks.
Comment 15 Tijl Coosemans freebsd_committerfreebsd_triage 2026-05-11 10:47:09 UTC
(In reply to commit-hook from comment #13)
You should also do a PORTREVISION bump so existing llvm packages are rebuilt.
Comment 16 Alastair Hogge 2026-05-11 10:51:10 UTC
> You should also do a PORTREVISION bump so existing llvm packages are rebuilt.

Yes. Thanks for the tip, some bulk builds I am running are still failing because they are not rebuilding llvm.
Comment 17 John Kennedy 2026-05-11 14:32:52 UTC
(In reply to John Kennedy from comment #10)
For what it's worth, that patch fixed my build(*).  That is a very limited test from my system:

mesa-dri-24.1.7_11.pkg: missing dependency: llvm19-19.1.7_1
spirv-llvm-translator-llvm19-19.1.18.pkg: missing dependency: llvm19-19.1.7_1
wlroots019-0.19.3.pkg: missing dependency: mesa-dri-24.1.7_11
sway-1.11_1.pkg: missing dependency: wlroots019-0.19.3


*:  I had to remove the existing llvm19 package to get it to rebuild with the changes because no revision # bump.
Comment 18 John Kennedy 2026-05-12 03:27:45 UTC
(In reply to commit-hook from comment #13)
commit 4fc6c5e1c9a43149a91c626c56ae6e33066449bc also worked fine, although I still don't think I've seen a PORTREVISION bump (still 1).
Comment 19 commit-hook freebsd_committerfreebsd_triage 2026-05-13 14:02:09 UTC
A commit in branch main references this bug:

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

commit b2fbc8d0f1889c65d5cceffb7b85f432a9a8ed65
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2026-05-12 08:55:49 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2026-05-13 13:47:05 +0000

    devel/llvm??: Bump PORTREVISION for 4fc6c5e1c9a4

    PR:             295111

 devel/llvm12/Makefile | 2 +-
 devel/llvm13/Makefile | 2 +-
 devel/llvm14/Makefile | 2 +-
 devel/llvm15/Makefile | 2 +-
 devel/llvm16/Makefile | 2 +-
 devel/llvm17/Makefile | 2 +-
 devel/llvm18/Makefile | 2 +-
 devel/llvm19/Makefile | 2 +-
 devel/llvm20/Makefile | 2 +-
 devel/llvm21/Makefile | 2 +-
 devel/llvm22/Makefile | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)
Comment 20 Mark Millard 2026-06-09 00:10:21 UTC
This can be closed as FIXED as far as I can tell: the likes of . . .

https://pkg-status.freebsd.org/beefy24/build.html?mastername=main-amd64-default&build=p40859a0a15a6_s16e5abf415b

Shows successful builds relateive to all of: llvm12 .. llvm22

and:

https://portsfallout.com/fallout?port=devel%2Fspirv-llvm-translator&maintainer=&env=&category=&flavor=

most recent fallout information is for: 2026-05-10 12:00

No reported failures after that: the commits stopped the
failures.