Skip to content

Commit

Permalink
Fixes for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
pgoodman committed Sep 22, 2020
1 parent bd26397 commit 5bc4714
Show file tree
Hide file tree
Showing 5 changed files with 497 additions and 11 deletions.
41 changes: 32 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ macro(target_public_headers TARGET)
set_target_properties(${TARGET} PROPERTIES PUBLIC_HEADER "${ARGN}")
endmacro()

option(ANVILL_INSTALL_PYTHON2_LIBS "Install Python 2 libraries")
option(ANVILL_INSTALL_PYTHON3_LIBS "Install Python 3 libraries" ON)

#
# libraries
#
Expand All @@ -49,6 +52,7 @@ add_subdirectory(lib/Version)
add_library(${ANVILL} STATIC
include/anvill/Type.h

lib/Arch/AArch64_C.cpp
lib/Arch/X86_C.cpp
lib/Arch/X86_FastCall.cpp
lib/Arch/X86_StdCall.cpp
Expand Down Expand Up @@ -114,8 +118,7 @@ set(SPECIFY_BITCODE anvill-specify-bitcode-${REMILL_LLVM_VERSION})
add_executable(${SPECIFY_BITCODE} Bitcode.cpp)
target_link_libraries(${SPECIFY_BITCODE} PRIVATE ${ANVILL})

add_custom_target(install_anvill_python
DEPENDS
set(ANVILL_PYTHON_SOURCES
setup.py
python/anvill/__init__.py
python/anvill/arch.py
Expand All @@ -131,14 +134,34 @@ add_custom_target(install_anvill_python
python/anvill/type.py
python/anvill/var.py)

add_custom_command(
TARGET install_anvill_python POST_BUILD
COMMAND which python3 && python3 setup.py install --force --user --prefix=
COMMENT "Installing Anvill Python 3 API"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

add_dependencies(${ANVILL}
install_anvill_python)
if(ANVILL_INSTALL_PYTHON2_LIBS)
add_custom_target(install_anvill_python2
DEPENDS ${ANVILL_PYTHON_SOURCES})

add_custom_command(
TARGET install_anvill_python2 POST_BUILD
COMMAND which python2 && python2 setup.py install --force --user --prefix=
COMMENT "Installing Anvill Python 2 API"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

add_dependencies(${ANVILL}
install_anvill_python2)
endif()

if(ANVILL_INSTALL_PYTHON3_LIBS)
add_custom_target(install_anvill_python3
DEPENDS ${ANVILL_PYTHON_SOURCES})

add_custom_command(
TARGET install_anvill_python3 POST_BUILD
COMMAND which python3 && python3 setup.py install --force --user --prefix=
COMMENT "Installing Anvill Python 3 API"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

add_dependencies(${ANVILL}
install_anvill_python3)
endif()

#
# install settings
Expand Down
2 changes: 1 addition & 1 deletion include/anvill/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct FunctionDecl {
// of the entry state of the function. For example, in amd64, it would be
// typical for the exit return stack pointer to be defined as `RSP + 8`, i.e.
// equivalent to the entry stack pointer, plus 8 bytes, due to the `ret`
// having popped off the return address. In a callee-cleanup
// having popped off the return address.
const remill::Register *return_stack_pointer{nullptr};
int64_t return_stack_pointer_offset{0};

Expand Down
Loading

0 comments on commit 5bc4714

Please sign in to comment.