1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

bsd.linker.mk: Use :C not :S for regex

Whilst ^ and $ are supported with C, those are special cases, and
general regex syntax like groups and alternations are not. Use the
correct modifier so we get a version number out that's not 0 (which is
what happens when it can't be parsed by the later code).

Fixes:		c4177f5b41 ("bsd.linker.mk: Handle Xcode 15 linker identification")
MFC after:	1 week
This commit is contained in:
Jessica Clarke 2023-07-24 01:50:55 +01:00
parent c4177f5b41
commit 7f9318a022

View File

@ -82,7 +82,7 @@ ${X_}LINKER_FREEBSD_VERSION= 0
.elif ${_ld_version:[1]:S/-classic$//} == "@(\#)PROGRAM:ld"
# bootstrap linker on MacOS
${X_}LINKER_TYPE= mac
_v= ${_ld_version:[2]:S/PROJECT:(ld64|dyld)-//}
_v= ${_ld_version:[2]:C/PROJECT:(ld64|dyld)-//}
# Convert version 409.12 to 409.12.0 so that the echo + awk below works
.if empty(_v:M[1-9]*.[0-9]*.[0-9]*) && !empty(_v:M[1-9]*.[0-9]*)
_v:=${_v}.0