File use-clang-for-sparse-llvm.patch of Package sparse
From: Jiri Slaby <jslaby@suse.cz>
Date: Thu, 4 Aug 2016 15:24:11 +0200
Subject: sparse-llvm: use clang
Patch-mainline: not yet
gcc does not understand -Wstring-conversion, so use clang for building
sparse-llvm.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,8 @@ ifeq ($(HAVE_LLVM),yes)
LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version)
ifeq ($(shell expr "$(LLVM_VERSION)" : '[3-9]\.'),2)
LLVM_PROGS := sparse-llvm
-$(LLVM_PROGS): LD := g++
+$(LLVM_PROGS): CC := clang
+$(LLVM_PROGS): LD := clang++
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cflags | sed -e "s/-DNDEBUG//g" | sed -e "s/-pedantic//g")
LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs)