diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rwxr-xr-x | bfd/load.py | 80 | ||||
-rw-r--r-- | bruiser/bruiser-extra.h | 1 | ||||
-rw-r--r-- | bruiser/bruiser.cpp | 127 | ||||
-rw-r--r-- | bruiser/bruiser.h | 3 | ||||
-rw-r--r-- | bruiser/compile_commands.json | 8 | ||||
-rw-r--r-- | bruiser/makefile | 6 |
8 files changed, 204 insertions, 31 deletions
diff --git a/.travis.yml b/.travis.yml index 14132c1..949d51e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,8 @@ before_script: - sudo apt-get install libboost-dev - git submodule init - git submodule update + - sudo apt-get install python3-all-dev -y + - sudo apt-get install libpython3-all-dev -y script: - make CXX=clang-5.0 LLVM_CONF=llvm-config-5.0 BUILD_MODE=COV_NO_CLANG -j2 @@ -84,6 +84,13 @@ make install ``` +mutator is also being hosted using [IPFS](https://github.com/ipfs/ipfs). To get it from IPFS just run:<br/> +```bash + +git clone https://ipfs.io/ipfs/QmdBBG76K5rNSWB4iK4ZhTtiZAkSsyDpiWzcPsPfnHY2ZA/mutator + +``` + If you don't have them, you can build them or get them from a repo.<br/> To build LLVM/Clang from source take a look at [here](https://clang.llvm.org/get_started.html) and [here](http://llvm.org/docs/GettingStarted.html).<br/> To build `safercpp-arr` you to need to build Clang with RTTI enabled.<br/> @@ -373,4 +380,5 @@ If the company/organization you represent wants to sponsor mutator, let me know. ### Contact You can email me at thabogre@gmail.com, there is also the twitter account for the mutator project, @xashmith and there is the mutator maillist, mutator-repost@freelists.org. You need to be a member though to be able to send mail on the maillist. The maillist is moderated.<br/> + <a href="https://twitter.com/xashmith" class="twitter-follow-button" data-show-count="false">Follow @xashmith</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> diff --git a/bfd/load.py b/bfd/load.py index ab60857..b04db5d 100755 --- a/bfd/load.py +++ b/bfd/load.py @@ -1,6 +1,14 @@ #!/bin/python3 -from enum import Enum +import argparse +import sys +class CLIArgParser(object): + def __init__(self): + parser = argparse.ArgumentParser() + parser.add_argument("--obj", type=str, help="path to the executbale, shared object or object you want to load in bruiser") + self.args = parser.parse_args() + if self.args.obj is None: + raise Exception("no object file provided. please specify an object with --obj.") class sh_type_e: SHT_NULL = 0x0 @@ -171,6 +179,7 @@ class ELF(object): for i in range(0, shnum): type = int.from_bytes(self.shhdr[i].sh_type, byteorder="little", signed=False) if type == sh_type_e.SHT_SYMTAB: + print(Colors.green, end="") print("size: " + repr(int.from_bytes(self.shhdr[i].sh_size, byteorder="little"))) print("offset: " + repr(int.from_bytes(self.shhdr[i].sh_offset, byteorder="little"))) self.so.seek(int.from_bytes(self.shhdr[i].sh_offset, byteorder="little", signed=False), 0) @@ -182,8 +191,9 @@ class ELF(object): for j in range(0, num): self.read_st_entry(symbol_tb[offset:offset + 24], self.string_tb_e) offset += 8*24 + print(Colors.ENDC) if type == sh_type_e.SHT_DYNSYM: - print("found dyn") + print(Colors.green, end="") print("size: " + repr(int.from_bytes(self.shhdr[i].sh_size, byteorder="little"))) print("offset: " + repr(int.from_bytes(self.shhdr[i].sh_offset, byteorder="little"))) self.so.seek(int.from_bytes(self.shhdr[i].sh_offset, byteorder="little", signed=False), 0) @@ -195,6 +205,7 @@ class ELF(object): for j in range(0, num): self.read_st_entry(symbol_tb[offset:offset + 24], self.string_tb_e_dyn) offset += 8*24 + print(Colors.ENDC) # 32 or 64 def read_ELF_H(self, size): @@ -272,27 +283,36 @@ class ELF(object): dummy.st_size = st[16:24] entry_list.append(dummy) + def dump_objs(self): + for iter in self.string_tb_e: + self.so.seek(int.from_bytes(iter.st_value, byteorder="little")) + obj = self.so.read(int.from_bytes(iter.st_size, byteorder="little")) + for byte in obj: + print(chr(byte)) + def dump_symbol_idx(self): + print(Colors.green + "symbol:" + Colors.ENDC) for iter in self.string_tb_e: - print("symbol:") - print("-----------------------------------------------------------------") - print("name: " + repr(int.from_bytes(iter.st_name, byteorder="little"))) - print("size: " + repr(int.from_bytes(iter.st_size, byteorder="little"))) - print("value: " + repr(int.from_bytes(iter.st_value, byteorder="little"))) - print("info: " + repr(int.from_bytes(iter.st_info, byteorder="little"))) - print("other: " + repr(int.from_bytes(iter.st_other, byteorder="little"))) - print("shndx: " + repr(int.from_bytes(iter.st_shndx, byteorder="little"))) - print("-----------------------------------------------------------------") + if not int.from_bytes(iter.st_size, byteorder="little") == 0: + print("-----------------------------------------------------------------") + print(Colors.blue + "name: " + Colors.cyan + repr(int.from_bytes(iter.st_name, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "size: " + Colors.cyan + repr(int.from_bytes(iter.st_size, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "value: " + Colors.cyan + repr(int.from_bytes(iter.st_value, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "info: " + Colors.cyan + repr(int.from_bytes(iter.st_info, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "other: " + Colors.cyan + repr(int.from_bytes(iter.st_other, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "shndx: " + Colors.cyan + repr(int.from_bytes(iter.st_shndx, byteorder="little")) + Colors.ENDC) + print("-----------------------------------------------------------------") + print(Colors.green + "dyn symbol:" + Colors.ENDC) for iter in self.string_tb_e_dyn: - print("dyn symbol:") - print("-----------------------------------------------------------------") - print("name: " + repr(int.from_bytes(iter.st_name, byteorder="little"))) - print("size: " + repr(int.from_bytes(iter.st_size, byteorder="little"))) - print("value: " + repr(int.from_bytes(iter.st_value, byteorder="little"))) - print("info: " + repr(int.from_bytes(iter.st_info, byteorder="little"))) - print("other: " + repr(int.from_bytes(iter.st_other, byteorder="little"))) - print("shndx: " + repr(int.from_bytes(iter.st_shndx, byteorder="little"))) - print("-----------------------------------------------------------------") + if not int.from_bytes(iter.st_size, byteorder="little") == 0: + print("-----------------------------------------------------------------") + print(Colors.blue + "name: " + Colors.cyan + repr(int.from_bytes(iter.st_name, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "size: " + Colors.cyan + repr(int.from_bytes(iter.st_size, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "value: " + Colors.cyan + repr(int.from_bytes(iter.st_value, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "info: " + Colors.cyan + repr(int.from_bytes(iter.st_info, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "other: " + Colors.cyan + repr(int.from_bytes(iter.st_other, byteorder="little")) + Colors.ENDC) + print(Colors.blue + "shndx: " + Colors.cyan + repr(int.from_bytes(iter.st_shndx, byteorder="little")) + Colors.ENDC) + print("-----------------------------------------------------------------") def dump_header(self): print("------------------------------------------------------------------------------") @@ -372,6 +392,15 @@ class ELF(object): if chr(byte) == '\0': print() +class obj_loader(): + def __init__(self, bytes): + self.memory = bytes() + + def load(self, obj): + for byte in obj: + self.memory.append(byte) + + def ch_so_to_exe(path): so = open(path, "r+b") so.seek(16) @@ -388,14 +417,18 @@ def ch_exe_to_so(path): def main(): - so = openSO_r("./test/test.so") + #argparser = CLIArgParser() + #if argparser.args.obj is None: so = openSO_r("./test/test.so") + #else: so = openSO_r(argparser.args.obj) + so = openSO_r(sys.argv[1]) elf = ELF(so) elf.init(64) - #elf.dump_header() - #elf.dump_symbol_tb() + elf.dump_header() + elf.dump_symbol_tb() #elf.dump_phdrs() #elf.dump_shdrs() elf.dump_symbol_idx() + #elf.dump_objs() ''' so.close() ch_so_to_exe("./test/test.so") @@ -404,6 +437,7 @@ def main(): elf2.init(64) elf.dump_header() ''' + return 0; if __name__ == "__main__": main() diff --git a/bruiser/bruiser-extra.h b/bruiser/bruiser-extra.h index b6f7158..40af99f 100644 --- a/bruiser/bruiser-extra.h +++ b/bruiser/bruiser-extra.h @@ -121,6 +121,7 @@ std::vector<std::string> LUA_FUNCS = "changedirectory", "yolo", "pwd()", + "objload", "_G", "_VERSION", "assert", diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index 4549940..309e41d 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -54,6 +54,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.* /*other*/ #include "linenoise/linenoise.h" #include "lua-5.3.4/src/lua.hpp" +#include <Python.h> #include "luadummy.h" /**********************************************************************************************************************/ @@ -201,6 +202,80 @@ class LuaEngine lua_State* LS; }; /**********************************************************************************************************************/ +class PyExec { + public: + PyExec(std::string __py_script_name, std::string __py_func_name, std::string __obj_path ) : + py_script_name(__py_script_name), py_func_name(__py_func_name), obj_path(__obj_path) {} + + int run(void) { + //std::wstring py_sys_path = L"../bfd"; + Py_Initialize(); + int argc = 2; + //std::wstring argv[2]; + wchar_t* argv[2]; + argv[0] = Py_DecodeLocale((char*)py_script_name.c_str(), 0); + argv[1] = Py_DecodeLocale((char*)obj_path.c_str(), 0); + PySys_SetArgv(argc, argv); + pName = PyUnicode_DecodeFSDefault(py_script_name.c_str()); + PyRun_SimpleString("import sys\nsys.path.append(\"../bfd\")\n"); + pModule = PyImport_Import(pName); + Py_DECREF(pName); + + if (pModule != nullptr) { + pFunc = PyObject_GetAttrString(pModule, py_func_name.c_str()); + if (pFunc && PyCallable_Check(pFunc)) { + std::cout << GREEN << "function is callable." << NORMAL << "\n"; + pArgs = PyTuple_New(1); + pValue = PyUnicode_FromString(obj_path.c_str()); + PyTuple_SetItem(pArgs, 0, pValue); + pArgs = nullptr; + std::cout << BLUE << "calling python function..." << NORMAL << "\n"; + pValue = PyObject_CallObject(pFunc, pArgs); + std::cout << BLUE << "i made it here" << NORMAL << "\n"; + //Py_DECREF(pArgs); + if (pValue != nullptr) { + std::cout << GREEN << "call finished successfully." << NORMAL << "\n"; + printf("Result of call: %ld\n", PyLong_AsLong(pValue)); + Py_DECREF(pValue); + } else { + Py_DECREF(pFunc); + Py_DECREF(pModule); + PyErr_Print(); + std::cout << RED << "call failed." << NORMAL << "\n"; + fprintf(stderr, "Call failed\n"); + return EXIT_FAILURE; + } + } + else { + if (PyErr_Occurred()) PyErr_Print(); + fprintf(stderr, "Cannot find function\"%s\"\n", py_func_name.c_str()); + } + Py_XDECREF(pFunc); + Py_DECREF(pModule); + } + else { + PyErr_Print(); + fprintf(stderr, "Failed to load \"%ls\"\n", argv[0]); + return 1; + } + Py_Finalize(); + return 0; + } + + private: + std::string py_script_name; + std::string py_func_name; + std::string obj_path; + PyObject *pName; + PyObject *pModule; + PyObject *pDict; + PyObject *pFunc; + PyObject *pArgs; + PyObject *pValue; + int argc; + char** argv; +}; +/**********************************************************************************************************************/ class CompilationDatabaseProcessor { public: @@ -1040,12 +1115,61 @@ class LuaWrapper } /*clear the screen*/ - int BruiserLuaClear(lua_State* _ls) + int BruiserLuaClear(lua_State* __ls) { linenoiseClearScreen(); return 0; } + int BruiserPyLoader(lua_State* __ls ) { + int numargs = lua_gettop(__ls); + //std::string filename = "../bfd/load.py"; + std::string filename = "load"; + std::string funcname; + std::string objjpath; + + if (numargs == 2) { + std::cout << CYAN << "got args." << NORMAL << "\n"; + funcname = lua_tostring(__ls, 1); + objjpath = lua_tostring(__ls, 2); + } + else { + std::cout << RED << "wrong number of arguments provided. should give the python script name, python func name and its args.\n" << NORMAL; + return EXIT_FAILURE; + } + + std::cout << CYAN << "initing the py embed class...\n" << NORMAL; + PyExec py(filename.c_str(), funcname.c_str(), objjpath.c_str()); + + std::cout << CYAN << "forking python script...\n" << NORMAL; + pid_t pid = fork(); + + if (pid < 0) + { + PRINT_WITH_COLOR_LB(RED, "could not fork..."); + lua_pushnumber(__ls, EXIT_FAILURE); + } + + if (pid == 0) + { + std::cout << BLUE << "running load.py: " << NORMAL << "\n"; + py.run(); + lua_pushnumber(__ls, 0); + exit(EXIT_SUCCESS); + } + + if (pid > 0) + { + int status; + pid_t returned; + returned = waitpid(pid, &status, 0); + lua_pushnumber(__ls, returned); + } + + lua_pushnumber(__ls, 0); + return 1; + } + /*read the m0 report*/ int BruiserLuaM0(lua_State* __ls) { @@ -1631,6 +1755,7 @@ int main(int argc, const char **argv) lua_register(LE.GetLuaState(), "changedirectory", &LuaDispatch<&LuaWrapper::BruiserLuaChangeDirectory>); lua_register(LE.GetLuaState(), "yolo", &LuaDispatch<&LuaWrapper::BruiserLuaYolo>); lua_register(LE.GetLuaState(), "pwd", &LuaDispatch<&LuaWrapper::BruiserLuaPWD>); + lua_register(LE.GetLuaState(), "objload", &LuaDispatch<&LuaWrapper::BruiserPyLoader>); /*its just regisering the List function from LuaWrapper with X-macros.*/ #define X(__x1, __x2) lua_register(LE.GetLuaState(), #__x1, &LuaDispatch<&LuaWrapper::List##__x1>); diff --git a/bruiser/bruiser.h b/bruiser/bruiser.h index b4d4b4a..e311c7e 100644 --- a/bruiser/bruiser.h +++ b/bruiser/bruiser.h @@ -143,7 +143,8 @@ help CMDHelp[] = { {"getpaths()", "getpaths()", "gets the currently loaded paths that bruiser looks through", "none", "array of strings"}, {"getsourcefiles()", "getsourcefiles()", "gets the currently loaded source files that bruiser will look through", "none", "array of strings"}, {"changedirectory()", "changedirectory()", "changes bruiser's working directory. only use it when you know what you are doing.", "destination directory, [string]", "return value"}, - {"pwd()", "pwd()", "pwd", "", ""} + {"pwd()", "pwd()", "pwd", "", ""}, + {"objload()", "objload(\"main\", \"../bfd/test/test.so\")", "load the compiled functions into bruiser", "string", "success or failure"} }; /**********************************************************************************************************************/ /** diff --git a/bruiser/compile_commands.json b/bruiser/compile_commands.json index 6c247d1..ef1b5c5 100644 --- a/bruiser/compile_commands.json +++ b/bruiser/compile_commands.json @@ -1,6 +1,6 @@ [ { - "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -o bruiser.o bruiser.cpp", + "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -I/usr/include/python3.5m -o bruiser.o bruiser.cpp", "directory": "/home/bloodstalker/devi/hell2/bruiser", "file": "/home/bloodstalker/devi/hell2/bruiser/bruiser.cpp" }, @@ -10,17 +10,17 @@ "file": "/home/bloodstalker/devi/hell2/bruiser/linenoise/linenoise.c" }, { - "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -o CompletionHints.o CompletionHints.cpp", + "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -I/usr/include/python3.5m -o CompletionHints.o CompletionHints.cpp", "directory": "/home/bloodstalker/devi/hell2/bruiser", "file": "/home/bloodstalker/devi/hell2/bruiser/CompletionHints.cpp" }, { - "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -o mutagen.o mutagen.cpp", + "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -I/usr/include/python3.5m -o mutagen.o mutagen.cpp", "directory": "/home/bloodstalker/devi/hell2/bruiser", "file": "/home/bloodstalker/devi/hell2/bruiser/mutagen.cpp" }, { - "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -o ORCmutation.o ORCmutation.cpp", + "command": "c++ -c -I/home/bloodstalker/extra/llvm-clang-4/llvm/include -I/home/bloodstalker/extra/llvm-clang-4/build/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -fno-exceptions -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/bloodstalker/extra/llvm-clang-4/llvm/tools/clang/include -I/home/bloodstalker/extra/llvm-clang-4/build/tools/clang/include -std=c++1z -stdlib=libstdc++ -UNDEBUG -fexceptions -I/usr/include -I/usr/include/python3.5m -o ORCmutation.o ORCmutation.cpp", "directory": "/home/bloodstalker/devi/hell2/bruiser", "file": "/home/bloodstalker/devi/hell2/bruiser/ORCmutation.cpp" }, diff --git a/bruiser/makefile b/bruiser/makefile index 278da47..6fe4c60 100644 --- a/bruiser/makefile +++ b/bruiser/makefile @@ -3,7 +3,7 @@ include ../macros.mk #######################################VARS#################################### -CXX_FLAGS+=-I/usr/include +CXX_FLAGS+=-I/usr/include -I/usr/include/python3.5m BRUISER=bruiser LUA?=JIT LIB_LUA=./lua-5.3.4/src/liblua.a @@ -11,7 +11,8 @@ LIB_LUA_JIT=./LuaJIT/src/libluajit.a HEADER_LIST=bruiser.h bruiser-extra.h CompletionHints.h SRCS=bruiser.cpp, CompletionHints.cpp, ORCmutation.cpp, mutagen.cpp #for some reason without ld the build fails on ubuntu trusty on travis -EXTRA_LD_FLAGS+=-ldl +#EXTRA_LD_FLAGS+=-lpthread -ldl -lutil -lm -Xlinker -lpython3 +EXTRA_LD_FLAGS+=$(shell python3-config --ldflags) ######################################RULES#################################### .DEFAULT: all @@ -56,4 +57,5 @@ help: @echo 'there is help.' @echo 'all is the defualt target.' @echo 'clean runs clean.' + @echo 'deepclean will also clean the lua build' @echo 'for a more complete and detaild list of BUILD_MODE and other things look at the main makefiles help under project root.' |