Changeset View
Changeset View
Standalone View
Standalone View
share/mk/bsd.compiler.mk
Show All 13 Lines | |||||
# against 30300 for gcc likely isn't what you wanted (since versions of gcc | # against 30300 for gcc likely isn't what you wanted (since versions of gcc | ||||
# prior to 4.2 likely have no prayer of working). | # prior to 4.2 likely have no prayer of working). | ||||
# | # | ||||
# COMPILER_FREEBSD_VERSION is the compiler's __FreeBSD_cc_version value. | # COMPILER_FREEBSD_VERSION is the compiler's __FreeBSD_cc_version value. | ||||
# | # | ||||
# COMPILER_FEATURES will contain one or more of the following, based on | # COMPILER_FEATURES will contain one or more of the following, based on | ||||
# compiler support for that feature: | # compiler support for that feature: | ||||
# | # | ||||
# - c++11 : supports full (or nearly full) C++11 programming environment. | # - c++11: supports full (or nearly full) C++11 programming environment. | ||||
# - retpoline: supports the retpoline speculative execution vulnerability | |||||
# mitigation. | |||||
# | # | ||||
# These variables with an X_ prefix will also be provided if XCC is set. | # These variables with an X_ prefix will also be provided if XCC is set. | ||||
# | # | ||||
# This file may be included multiple times, but only has effect the first time. | # This file may be included multiple times, but only has effect the first time. | ||||
# | # | ||||
.if !target(__<bsd.compiler.mk>__) | .if !target(__<bsd.compiler.mk>__) | ||||
__<bsd.compiler.mk>__: | __<bsd.compiler.mk>__: | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
# If we get a literal "__FreeBSD_cc_version" back then the compiler | # If we get a literal "__FreeBSD_cc_version" back then the compiler | ||||
# is a non-FreeBSD build that doesn't support it or some other error | # is a non-FreeBSD build that doesn't support it or some other error | ||||
# occurred. | # occurred. | ||||
.if ${${X_}COMPILER_FREEBSD_VERSION} == "__FreeBSD_cc_version" | .if ${${X_}COMPILER_FREEBSD_VERSION} == "__FreeBSD_cc_version" | ||||
${X_}COMPILER_FREEBSD_VERSION= unknown | ${X_}COMPILER_FREEBSD_VERSION= unknown | ||||
.endif | .endif | ||||
.endif | .endif | ||||
${X_}COMPILER_FEATURES= | |||||
.if ${${X_}COMPILER_TYPE} == "clang" || \ | .if ${${X_}COMPILER_TYPE} == "clang" || \ | ||||
(${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) | (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) | ||||
${X_}COMPILER_FEATURES= c++11 | ${X_}COMPILER_FEATURES+= c++11 | ||||
.else | .endif | ||||
${X_}COMPILER_FEATURES= | .if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 | ||||
${X_}COMPILER_FEATURES+= retpoline | |||||
.endif | .endif | ||||
.else | .else | ||||
# Use CC's values | # Use CC's values | ||||
X_COMPILER_TYPE= ${COMPILER_TYPE} | X_COMPILER_TYPE= ${COMPILER_TYPE} | ||||
X_COMPILER_VERSION= ${COMPILER_VERSION} | X_COMPILER_VERSION= ${COMPILER_VERSION} | ||||
X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION} | X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION} | ||||
X_COMPILER_FEATURES= ${COMPILER_FEATURES} | X_COMPILER_FEATURES= ${COMPILER_FEATURES} | ||||
Show All 15 Lines |