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 <wangn...@huawei.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Joe Stringer <j...@ovn.org>
Cc: Zefan Li <lize...@huawei.com>
Cc: pi3or...@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.

Reply via email to