[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <584666A5.7090309@huawei.com>
Date: Tue, 6 Dec 2016 15:20:05 +0800
From: "Wangnan (F)" <wangnan0@...wei.com>
To: <acme@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <joe@....org>,
Alexei Starovoitov <ast@...com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
He Kuang <hekuang@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
Zefan Li <lizefan@...wei.com>, <pi3orama@....com>
Subject: Re: [PATCH v4 01/18] perf build: Check LLVM version in feature check
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 <wangnan0@...wei.com>
> Cc: Alexei Starovoitov <ast@...com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: He Kuang <hekuang@...wei.com>
> Cc: Jiri Olsa <jolsa@...nel.org>
> Cc: Joe Stringer <joe@....org>
> Cc: Zefan Li <lizefan@...wei.com>
> Cc: pi3orama@....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 <cstdio>
> +#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.
Powered by blists - more mailing lists