Certain ports hardcode which LLVM version they want. There are several cases: two common cases, and the uncommon cases.
:!: these data are almost certainly incomplete.
==== How LLVM versions get set ====
By default, the Makevar //LLVM_DEFAULT// is globally defined by the ports infrastructure via [[https://svnweb.freebsd.org/ports/head/Mk/bsd.default-versions.mk|Mk/bsd.default-versions.mk]]. Therefore, it should be under control of the user.
MarkLinimon believes that this global Makevar should not be overridden in port Makefiles.
Some ports use the //LLVM_DEFAULT// Makevar, but some use their own, or, worse, hardcode a version number.
==== Ports That Hardcode LLVM version ====
This is a common case -- but see [[ObsoleteLLVMVersions]] for the maintenance hassles it causes.
In general these are symbolic definitions via //LLVM_VER// or similar.
Example:
LLVM_VER= 90
BUILD_DEPENDS+= clang${LLVM_VER}:devel/llvm${LLVM_VER}
:!: We should standardize on a variable name. In use: //LLVM_VER// //LLVM_VERSION// //LLVMVER// //VBOX_LLVM_VER//.
| portname | hardcoding | maintainer |
| devel/flang | 70 | |
| devel/flang-clang | 70 | |
| lang/ponyc | 70 | |
| math/libpgmath | 70 | |
| benchmarks/libcelero | 80 | |
| devel/qtcreator | 80 | |
| devel/creduce | 80 | |
| devel/oclgrind | 80 | |
| devel/f18 | 80 | |
| devel/include-what-you-use | 80 | |
| misc/opennn | 80 | |
| security/afl | 80 | |
| devel/youcompleteme | 90 | |
| graphics/blender | 90 | |
| graphics/openshadinglanguage | 90 | |
| devel/cpp2py | 10 | |
| lang/crystal | 10 | |
==== Ports That Hardcode Dependencies ====
This is a common case -- but should be folded into the above by factoring out the number into one definition as above.
Suboptimal:
BUILD_DEPENDS+= clang90:devel/llvm90
Preferred (as above):
LLVM_VER= 90
BUILD_DEPENDS+= clang${LLVM_VER}:devel/llvm${LLVM_VER}
| portname | hardcoding | PR |
(these are believed to be fixed as of 20191204)
==== Ports That Redefine CC / CPP / CXX ====
Some ports hardcode which version they want by redefining the //CC// and/or //CPP// and/or //CXX// Makevars. Please see [[HardcodedCCVersions]].
In [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229626|PR 229626]] MarkLinimon claims that this is a bad implementation, and that the values instead should be passed via environment variables. However, that PR as yet has not received any attention.
==== Ports That Redefine LLVM_VERSION ====
MarkLinimon believes that this global Makevar should not be overridden in port Makefiles (see above).
Preferred usage:
.if
LLVM_VER= 90
.else
LLVM_VER ${LLVM_DEFAULT}
.endif
BUILD_DEPENDS+= clang${LLVM_VER}:devel/llvm${LLVM_VER}
The following list has some overlap with the above.
| portname | redefinition | maintainer |
| devel/oclgrind | 80 | |
| security/afl | 80 | |
| graphics/mesa-dri/Makefile.common | 10 | |
| lang/pocl | ${MESA_LLVM_VER:U11} | |
==== Ports That Are Grossly Wrong ====
:!: TODO document
textproc/castxml
----
{{tag>Ports Todo}}