HomeFreeBSD

devel/spirv-llvm-translator: unbreak llvm12 flavor with clang 21

Description

devel/spirv-llvm-translator: unbreak llvm12 flavor with clang 21

With clang 21 the llvm12 flavor of devel/spirv-llvm-translator fails to
build, with errors similar to:

In file included from /wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/OCLTypeToSPIRV.cpp:44:
In file included from /wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/OCLUtil.h:42:
In file included from /wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/SPIRVInternal.h:43:
In file included from /wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/libSPIRV/SPIRVEnum.h:44:
In file included from /wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/libSPIRV/SPIRVOpCode.h:45:
/wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/libSPIRV/spirv_internal.hpp:120:31: error: constexpr variable 'FunctionControlOptNoneINTELMask' must be initialized by a constant expression
  120 | constexpr FunctionControlMask FunctionControlOptNoneINTELMask =
      |                               ^
  121 |     static_cast<FunctionControlMask>(IFunctionControlOptNoneINTELMask);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/spirv-llvm-translator/work-llvm12/SPIRV-LLVM-Translator-12.0.1/lib/SPIRV/libSPIRV/spirv_internal.hpp:121:5: note: integer value 65536 is outside the valid range of values [0, 15] for the enumeration type 'FunctionControlMask'
  121 |     static_cast<FunctionControlMask>(IFunctionControlOptNoneINTELMask);
      |     ^

This is because clang 21 no longer allows enum values outside of the
valid range. Upstream spirv refactored a lot in this area, so the llvm13
flavor and later compile fine with clang 21.

Fix it by explicitly making the underlying type for the two affected
enums uint32_t.

PR: 293293
MFH: 2026Q1
(cherry picked from commit d50aa610760e499062d3f050b4402e97531fe376)

Details

Provenance
dimAuthored on Feb 19 2026, 12:31 PM
jbeichCommitted on Feb 20 2026, 3:04 PM
Parents
R11:90f512cec35b: devel/spirv-llvm-translator: split port patches by flavor
Branches
Unknown
Tags
Unknown