mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix ld-version.sh script if LLD was built with LLD_VENDOR
@ 2021-03-02 22:12 Bernhard Rosenkränzer
  2021-03-03  4:02 ` Nathan Chancellor
  2021-03-04  3:34 ` Masahiro Yamada
  0 siblings, 2 replies; 7+ messages in thread
From: Bernhard Rosenkränzer @ 2021-03-02 22:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Bernhard Rosenkränzer

If LLD was built with -DLLD_VENDOR="xyz", ld.lld --version output
will prefix LLD_VENDOR. Since LLD_VENDOR can contain spaces, the
LLD identifier isn't guaranteed to be $2 either.

Adjust the version checker to handle such versions of lld.

Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
---
 scripts/ld-version.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
index a463273509b5..4c042a306e22 100755
--- a/scripts/ld-version.sh
+++ b/scripts/ld-version.sh
@@ -49,6 +49,18 @@ elif [ "$1" = LLD ]; then
 	min_version=$lld_min_version
 	name=LLD
 	disp_name=LLD
+elif echo "$@" |grep -q ' LLD '; then
+	# if LLD was built with -DLLD_VENDOR="xyz", it ld.lld --version
+	# says "xyz LLD [...]". Since LLD_VENDOR may contain spaces, we
+	# don't know the exact position of "LLD" and the version info
+	# at this point
+	while [ "$1" != "LLD" ]; do
+		shift
+	done
+	version=$2
+	min_version=$lld_min_version
+	name=LLD
+	disp_name=LLD
 else
 	echo "$orig_args: unknown linker" >&2
 	exit 1
-- 
2.30.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-09 17:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 22:12 [PATCH] Fix ld-version.sh script if LLD was built with LLD_VENDOR Bernhard Rosenkränzer
2021-03-03  4:02 ` Nathan Chancellor
2021-03-03 11:38   ` Masahiro Yamada
2021-03-03 17:45     ` Nathan Chancellor
2021-03-04  3:34 ` Masahiro Yamada
2021-03-09 17:09   ` Masahiro Yamada
2021-03-09 17:31     ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®