diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5c0f3bc --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "unicorn"] + path = unicorn + url = https://github.com/reswitched/unicorn.git diff --git a/.travis.yml b/.travis.yml index 36dda82..a3a3c47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,14 +20,14 @@ addons: - liblz4-dev install: - pip2 install --user -r requirements.txt - - git clone https://github.com/reswitched/unicorn.git - - cd unicorn - - UNICORN_ARCHS="aarch64" ./make.sh - - sudo ./make.sh install - - cd .. - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then CC=clang++-5.0; Ld=ld.lld-5.0; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then CC=clang++; brew update; brew install lz4; fi -script: make LD=$Ld CC=$CC + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then CXX=clang++-5.0; fi + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + CXX=clang++ + brew update + brew install lz4 + fi +script: make CXX=$CXX after_success: - mv ctu ctu_$TRAVIS_OS_NAME deploy: diff --git a/Makefile b/Makefile index 14d1e1b..7c174db 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -CC := clang++-5.0 +CXX := clang++-5.0 PYTHON2 := python2 CPP_FILES := $(wildcard *.cpp) IPCIMPL_FILES := $(wildcard ipcimpl/*.cpp) H_FILES := $(wildcard *.h) ID_FILES := $(wildcard ipcdefs/*.id) -CC_FLAGS := -std=c++1z -I. -Weverything -Werror -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-header-hygiene -Wno-shadow-field-in-constructor -Wno-old-style-cast -Wno-missing-prototypes -Wno-unused-parameter -Wno-padded -Wno-sign-conversion -Wno-sign-compare -Wno-shadow-uncaptured-local -Wno-weak-vtables -Wno-switch -Wno-unused-variable -Wno-unused-private-field -Wno-variadic-macros -Wno-unused-macros -Wno-gnu-anonymous-struct -Wno-nested-anon-types -Wno-reorder -Wno-missing-noreturn -Wno-unreachable-code -Wno-gnu-zero-variadic-macro-arguments -Wno-cast-align -DLZ4_DISABLE_DEPRECATE_WARNINGS -Wno-undefined-func-template -Wno-format-nonliteral -Wno-documentation-unknown-command $(EXTRA_CC_FLAGS) -LD_FLAGS := -lunicorn -lpthread -llz4 $(EXTRA_LD_FLAGS) +CXX_FLAGS := -std=c++1z -I. -isystem unicorn/include/ -Weverything -Werror -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-header-hygiene -Wno-shadow-field-in-constructor -Wno-old-style-cast -Wno-missing-prototypes -Wno-unused-parameter -Wno-padded -Wno-sign-conversion -Wno-sign-compare -Wno-shadow-uncaptured-local -Wno-weak-vtables -Wno-switch -Wno-unused-variable -Wno-unused-private-field -Wno-variadic-macros -Wno-unused-macros -Wno-gnu-anonymous-struct -Wno-nested-anon-types -Wno-reorder -Wno-missing-noreturn -Wno-unreachable-code -Wno-gnu-zero-variadic-macro-arguments -Wno-cast-align -DLZ4_DISABLE_DEPRECATE_WARNINGS -Wno-undefined-func-template -Wno-format-nonliteral -Wno-documentation-unknown-command $(EXTRA_CXX_FLAGS) +LD_FLAGS := -lpthread -llz4 $(EXTRA_LD_FLAGS) OBJ_FILES := $(CPP_FILES:.cpp=.o) $(IPCIMPL_FILES:.cpp=.o) @@ -18,19 +18,23 @@ IpcStubs.h: $(ID_FILES) $(IPCIMPL_FILES) ipcdefs/auto.id generateIpcStubs.py idp $(PYTHON2) generateIpcStubs.py %.pch: % IpcStubs.h $(H_FILES) - $(CC) -x c++-header $(CC_FLAGS) -o $@ $< + $(CXX) -x c++-header $(CXX_FLAGS) -o $@ $< -ctu: Ctu.h.pch $(OBJ_FILES) $(H_FILES) - $(CC) -o ctu $(LD_FLAGS) $(OBJ_FILES) +ctu: Ctu.h.pch $(OBJ_FILES) $(H_FILES) unicorn/libunicorn.a + $(CXX) -o ctu $(OBJ_FILES) $(LD_FLAGS) unicorn/libunicorn.a Ipc.o: Ipc.cpp Ctu.h.pch - $(CC) $(CC_FLAGS) -c -g -o $@ $< + $(CXX) $(CXX_FLAGS) -c -g -o $@ $< %.o: %.cpp Ctu.h.pch - $(CC) $(CC_FLAGS) -include Ctu.h -c -g -o $@ $< + $(CXX) $(CXX_FLAGS) -include Ctu.h -c -g -o $@ $< + +unicorn/libunicorn.a: unicorn/make.sh + cd unicorn/ && UNICORN_QEMU_FLAGS="--python=$(PYTHON2)" UNICORN_ARCHS="aarch64" ./make.sh clean: rm -f *.o rm -f *.pch rm -f ipcimpl/*.o rm -f ctu + $(MAKE) -C unicorn clean diff --git a/unicorn b/unicorn new file mode 160000 index 0000000..63b6417 --- /dev/null +++ b/unicorn @@ -0,0 +1 @@ +Subproject commit 63b641724330a6631942aac7e2a1904c8fa1fc9f