mirror of
https://github.com/reswitched/Mephisto.git
synced 2024-05-12 01:34:52 -04:00
make unicorn a submodule and static link it to make our binaries easier to run
This commit is contained in:
parent
1a21bb2666
commit
a88eff8c49
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "unicorn"]
|
||||
path = unicorn
|
||||
url = https://github.com/reswitched/unicorn.git
|
16
.travis.yml
16
.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:
|
||||
|
|
20
Makefile
20
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
|
||||
|
|
1
unicorn
Submodule
1
unicorn
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 63b641724330a6631942aac7e2a1904c8fa1fc9f
|
Loading…
Reference in a new issue