about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPierre Lalet <pierre@droids-corp.org>2017-11-28 17:24:02 +0100
committerGitHub <noreply@github.com>2017-11-28 17:24:02 +0100
commit52cec00d2b3162b8c622d7a1a1ec9b6752bfc614 (patch)
tree99eb9f6310629df9c056f646f70eae5a3bee29bb
parent427cd4ee61dbe65b5e713b8f7f78741d62687449 (diff)
parentd95526bd122c176dc954c306e4aaf62a71cf8e0e (diff)
downloadmiasm-52cec00d2b3162b8c622d7a1a1ec9b6752bfc614.tar.gz
miasm-52cec00d2b3162b8c622d7a1a1ec9b6752bfc614.zip
Merge pull request #640 from commial/fix/support-llvmlite-0.20
Fix/support llvmlite 0.20
-rw-r--r--.travis.yml15
-rw-r--r--miasm2/jitter/llvmconvert.py4
2 files changed, 9 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index 81e571c3..148d4a9f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,21 +1,22 @@
 sudo: false
+dist: trusty
 language: python
 python:
 - "2.7"
 addons:
     apt:
-        sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
+        sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
         packages:
             - make
             - gcc
             - python-virtualenv
             - unzip
-            - llvm-3.8
-            - llvm-3.8-dev
+            - llvm-4.0
+            - llvm-4.0-dev
             - g++-5
 before_script:
 - "cd .."
-- "export LLVM_CONFIG=$(which llvm-config-3.8)"
+- "export LLVM_CONFIG=$(which llvm-config-4.0)"
 - "export CXX=$(which g++-5)"
 # make virtual env
 - "python /usr/lib/python2.7/dist-packages/virtualenv.py virtualenv;"
@@ -27,11 +28,9 @@ before_script:
 - "make && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd);cd ..;"
 - "cp tinycc/libtcc.h include"
 - "cp tinycc/libtcc.so.1.0 tinycc/libtcc.so"
-# install llvmlite, using the system libdtc++ instead of statically linking it
+# install llvmlite
 - "pip install enum34"
-- "git clone https://github.com/numba/llvmlite llvmlite && cd llvmlite && git checkout 95d8c7c"
-- "sed -i 's/-static-libstdc++ //' ffi/Makefile.linux"
-- "python setup.py install && cd .."
+- "pip install llvmlite"
 # install elfesteem
 - "git clone https://github.com/serpilliere/elfesteem elfesteem && cd elfesteem && python setup.py install && cd ..;"
 # install pyparsing
diff --git a/miasm2/jitter/llvmconvert.py b/miasm2/jitter/llvmconvert.py
index f84f7ed5..0f88d842 100644
--- a/miasm2/jitter/llvmconvert.py
+++ b/miasm2/jitter/llvmconvert.py
@@ -571,14 +571,14 @@ class LLVMFunction():
 
         base_name = "printf_format"
         count = 0
-        while self.mod.get_global("%s_%d" % (base_name, count)):
+        while "%s_%d" % (base_name, count) in self.mod.globals:
             count += 1
         global_fmt = self.global_constant("%s_%d" % (base_name, count),
                                           fmt_bytes)
         fnty = llvm_ir.FunctionType(llvm_ir.IntType(32), [cstring],
                                     var_arg=True)
         # Insert printf()
-        fn = mod.get_global('printf')
+        fn = mod.globals.get('printf', None)
         if fn is None:
             fn = llvm_ir.Function(mod, fnty, name="printf")
         # Call