diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-02-19 21:12:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-02-19 21:12:59 +0000 |
commit | eb834d9f1b7de191b4ce4787759cf8735cac6102 (patch) | |
tree | de42c43278d035cd5be3cd01789ed1336af57f39 /Makefile.inc1 | |
parent | 1ddda2eb2400a56995c5b7baed5e07bfe8bd21d5 (diff) | |
download | src-eb834d9f1b7de191b4ce4787759cf8735cac6102.tar.gz src-eb834d9f1b7de191b4ce4787759cf8735cac6102.zip |
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. :)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23691
Notes
Notes:
svn path=/head/; revision=358132
Diffstat (limited to 'Makefile.inc1')
-rw-r--r-- | Makefile.inc1 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index 4f7aaae6d654..0139ca875262 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -272,9 +272,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]}' \ |