Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752340AbcLFHUY (ORCPT ); Tue, 6 Dec 2016 02:20:24 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:40037 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbcLFHUW (ORCPT ); Tue, 6 Dec 2016 02:20:22 -0500 Subject: Re: [PATCH v4 01/18] perf build: Check LLVM version in feature check To: References: <20161206071356.5312-1-wangnan0@huawei.com> <20161206071356.5312-2-wangnan0@huawei.com> CC: , , Alexei Starovoitov , Arnaldo Carvalho de Melo , He Kuang , Jiri Olsa , Zefan Li , From: "Wangnan (F)" Message-ID: <584666A5.7090309@huawei.com> Date: Tue, 6 Dec 2016 15:20:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20161206071356.5312-2-wangnan0@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1623 Lines: 47 On 2016/12/6 15:13, Wang Nan wrote: > Cancel builtin llvm and clang support when LLVM version is > less than 3.9.0: following commits uses newer API. > > Since Clang/LLVM's API is not guaranteed to be stable, > add a test-llvm-version.cpp feature checker, issue warning if > LLVM found in compiling environment is not tested yet. > > Signed-off-by: Wang Nan > Cc: Alexei Starovoitov > Cc: Arnaldo Carvalho de Melo > Cc: He Kuang > Cc: Jiri Olsa > Cc: Joe Stringer > Cc: Zefan Li > Cc: pi3orama@163.com > --- > tools/build/feature/Makefile | 8 ++++++-- > tools/build/feature/test-llvm-version.cpp | 12 ++++++++++++ > tools/build/feature/test-llvm.cpp | 5 +++++ > tools/perf/Makefile.config | 8 ++++++-- > 4 files changed, 29 insertions(+), 4 deletions(-) > create mode 100644 tools/build/feature/test-llvm-version.cpp [SNIP] > diff --git a/tools/build/feature/test-llvm-version.cpp b/tools/build/feature/test-llvm-version.cpp > new file mode 100644 > index 0000000..e86b642 > --- /dev/null > +++ b/tools/build/feature/test-llvm-version.cpp > @@ -0,0 +1,12 @@ > +#include > +#include "llvm/Config/llvm-config.h" > + > +#define NUM_VERSION (((LLVM_VERSION_MAJOR) << 16) + (LLVM_VERSION_MINOR << 8) + LLVM_VERSION_PATCH) > +#define pass int main() {printf("%x\n", NUM_VERSION); return 0;} > + > +#if NUM_VERSION >= 0x030900 > +pass > +#else > +# error This LLVM is not tested yet. > +#endif > + Sorry for this blank line. Will resend.