lkml.org 
[lkml]   [2016]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v4 01/18] perf build: Check LLVM version in feature check
    From
    Date


    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@huawei.com>
    > Cc: Alexei Starovoitov <ast@fb.com>
    > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    > Cc: He Kuang <hekuang@huawei.com>
    > Cc: Jiri Olsa <jolsa@kernel.org>
    > Cc: Joe Stringer <joe@ovn.org>
    > Cc: Zefan Li <lizefan@huawei.com>
    > 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 <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.

    \
     
     \ /
      Last update: 2016-12-06 08:20    [W:4.054 / U:1.336 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site