* [PATCH] build: fix LLVM version detection
@ 2020-04-20 15:53 Quentin Monnet
2020-05-14 21:10 ` Luc Van Oostenryck
0 siblings, 1 reply; 2+ messages in thread
From: Quentin Monnet @ 2020-04-20 15:53 UTC (permalink / raw)
To: linux-sparse; +Cc: Quentin Monnet
The regex match used for detecting the LLVM version works for versions
with a single-digit major number. Now that LLVM v10 is out, detection
can fail, resulting in sparse-llvm not being built.
Fix detection by extracting the major version number to compare with the
minimum supported.
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 85d15edca948..e93cfd66d0c9 100644
--- a/Makefile
+++ b/Makefile
@@ -183,7 +183,8 @@ arch := x32
endif
ifneq ($(filter ${arch},i386 i486 i586 i686 x86_64 amd64),)
LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version)
-ifeq ($(shell expr "$(LLVM_VERSION)" : '[3-9]\.'),2)
+LLVM_VERSION_MAJOR:=$(firstword $(subst ., ,$(LLVM_VERSION)))
+ifeq ($(shell expr "$(LLVM_VERSION_MAJOR)" '>=' 3),1)
LLVM_PROGS := sparse-llvm
$(LLVM_PROGS): LD := g++
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] build: fix LLVM version detection
2020-04-20 15:53 [PATCH] build: fix LLVM version detection Quentin Monnet
@ 2020-05-14 21:10 ` Luc Van Oostenryck
0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2020-05-14 21:10 UTC (permalink / raw)
To: Quentin Monnet; +Cc: linux-sparse
On Mon, Apr 20, 2020 at 04:53:52PM +0100, Quentin Monnet wrote:
> The regex match used for detecting the LLVM version works for versions
> with a single-digit major number. Now that LLVM v10 is out, detection
> can fail, resulting in sparse-llvm not being built.
>
> Fix detection by extracting the major version number to compare with the
> minimum supported.
Sorry for the late reply.
Applied & pushed. Thanks.
-- Luc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-14 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 15:53 [PATCH] build: fix LLVM version detection Quentin Monnet
2020-05-14 21:10 ` Luc Van Oostenryck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).