From d98e1c62c3d9e9d9b13063d088a6c596f91245b7 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 29 Apr 2020 18:51:34 +0000 Subject: [PATCH] MF10 r352637,r358076: correct Clang and lld version checks r352637 (mhorne): Allow for compiler versions >= 10 r358076 (dim): Correctly recognize linker versions greater than 10.0. These routines determine the host compiler and linker version, and caused attempts to build 12.1-RELEASE on 13-CURRENT to fail after the latter was updated to Clang 10. We don't guarantee such a build config to work, but it is used by FreeBSD ports build processes. As a result the fixes from stable/12 will be included with the next set of advisories, and are being committed to the branch now to unblock ports builds. PR: 245973 Reported by: sbruno, antoine Approved by: so Errata: EN-20:10.build Sponsored by: The FreeBSD Foundation --- share/mk/bsd.compiler.mk | 2 +- share/mk/bsd.linker.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index df566f869d3..cd87740730e 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -168,7 +168,7 @@ ${X_}COMPILER_TYPE:= clang . endif .endif .if !defined(${X_}COMPILER_VERSION) -${X_}COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +${X_}COMPILER_VERSION!=echo "${_v:M[1-9]*.[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif diff --git a/share/mk/bsd.linker.mk b/share/mk/bsd.linker.mk index caf4fccbae0..b53bb7fab82 100644 --- a/share/mk/bsd.linker.mk +++ b/share/mk/bsd.linker.mk @@ -59,7 +59,7 @@ _ld_version!= (${${ld}} --version || echo none) | sed -n 1p .if ${_ld_version:[1..2]} == "GNU ld" ${X_}LINKER_TYPE= bfd ${X_}LINKER_FREEBSD_VERSION= 0 -_v= ${_ld_version:M[1-9].[0-9]*:[1]} +_v= ${_ld_version:M[1-9]*.[0-9]*:[1]} .elif ${_ld_version:[1]} == "LLD" ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} @@ -71,7 +71,7 @@ ${X_}LINKER_FREEBSD_VERSION!= \ ${X_}LINKER_TYPE= bfd _v= 2.17.50 .endif -${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \ +${X_}LINKER_VERSION!= echo "${_v:M[1-9]*.[0-9]*}" | \ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .undef _ld_version .undef _v -- 2.45.0