Date: Mon, 2 Mar 2020 07:11:37 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r358527 - in stable/12: . share/mk Message-ID: <202003020711.0227Bb5E080140@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Mon Mar 2 07:11:37 2020 New Revision: 358527 URL: https://svnweb.freebsd.org/changeset/base/358527 Log: MFC r358132: Take LINKER_FREEBSD_VERSION from numerical field after dash Summary: With COMPILER_FREEBSD_VERSION, we use a numeric value that we bump each time we make a change that requires re-bootstrapping, but with the linker variant, we instead take the entire part after "FreeBSD", as in this example version output: LLD 9.0.1 (FreeBSD c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006) (compatible with GNU linkers) E.g., LINKER_FREEBSD_VERSION is currently being set to "c1a0a213378a458fbea1a5c77b315c7dce08fd05-1300006". This means that *any* new upstream lld version will cause re-bootstrapping. We should only look at the numerical field we append after a dash instead. This review attempts to make it so. The only thing I am not happy about is the post-processing of awk output in Makefile.inc1. I notice that our awk does not have gensub(), so it can't substitute a numbered sub-regex with \1, \2, etc. Suggestions welcome. :) Differential Revision: https://reviews.freebsd.org/D23691 Modified: stable/12/Makefile.inc1 stable/12/share/mk/bsd.linker.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Mon Mar 2 06:35:26 2020 (r358526) +++ stable/12/Makefile.inc1 Mon Mar 2 07:11:37 2020 (r358527) @@ -280,9 +280,10 @@ WANT_LINKER_TYPE= !make(test-system-compiler) .if ${WANT_LINKER_TYPE} == "lld" WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/VCSVersion.inc -WANT_LINKER_FREEBSD_VERSION!= \ +_WANT_LINKER_FREEBSD_VERSION!= \ awk '$$2 == "LLD_REVISION" {gsub(/"/, "", $$3); print $$3}' \ ${SRCDIR}/${WANT_LINKER_FREEBSD_VERSION_FILE} || echo unknown +WANT_LINKER_FREEBSD_VERSION=${_WANT_LINKER_FREEBSD_VERSION:C/.*-(.*)/\1/} WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc WANT_LINKER_VERSION!= \ awk '$$2 == "LLD_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ Modified: stable/12/share/mk/bsd.linker.mk ============================================================================== --- stable/12/share/mk/bsd.linker.mk Mon Mar 2 06:35:26 2020 (r358526) +++ stable/12/share/mk/bsd.linker.mk Mon Mar 2 07:11:37 2020 (r358527) @@ -63,9 +63,11 @@ _v= ${_ld_version:M[1-9]*.[0-9]*:[1]} .elif ${_ld_version:[1]} == "LLD" ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} -${X_}LINKER_FREEBSD_VERSION!= \ - ${${ld}} --version | \ - awk '$$3 ~ /FreeBSD/ {print substr($$4, 1, length($$4)-1)}' +.if ${_ld_version:[3]} == "(FreeBSD" +${X_}LINKER_FREEBSD_VERSION:= ${_ld_version:[4]:C/.*-(.*)\)/\1/} +.else +${X_}LINKER_FREEBSD_VERSION= 0 +.endif .else .warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd ${X_}LINKER_TYPE= bfd
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003020711.0227Bb5E080140>