Skip to content

Commit

Permalink
Merge remote-tracking branch 'mx297/master' into arm64/feature/semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
ssunny7 committed Dec 1, 2016
2 parents 05b7531 + dd1b12e commit c2c3348
Show file tree
Hide file tree
Showing 180 changed files with 10,145 additions and 5,412 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -92,6 +92,7 @@ CMakeFiles
CMakeCache.txt
cmake_install.cmake
*/cmake_install.cmake
*/*_CXX_cotire.cmake
Makefile
*/Makefile
*.eps
Expand All @@ -112,3 +113,8 @@ DyninstAPI*.tgz
common/h/version.h
Doxyfile
doxyfiles/*
*/*.dir/
*/Debug/
*/Release/
cotire/
.idea/*
23 changes: 23 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -10,7 +10,7 @@ env:
addons:
apt:
sources:
- kalakris-cmake
- kubuntu-backports
- ubuntu-toolchain-r-test
- boost-latest
packages:
Expand Down
45 changes: 10 additions & 35 deletions CMakeLists.txt
Expand Up @@ -19,32 +19,21 @@ include (${DYNINST_ROOT}/cmake/shared.cmake)
configure_file(cmake/version.h.in common/h/version.h)
include_directories(${PROJECT_BINARY_DIR})
include_directories(${PROJECT_BINARY_DIR}/common/h)
if(${PLATFORM} MATCHES nt)
set (HEADER_DIRS common
set (HEADER_DIRS common
dataflowAPI
dyninstAPI
dynutil
instructionAPI
parseAPI
patchAPI
proccontrol
stackwalk
symtabAPI
)
else()
set (HEADER_DIRS common
dataflowAPI
if(NOT ${PLATFORM} MATCHES nt)
set (HEADER_DIRS ${HEADER_DIRS}
dwarf
dyninstAPI
dynutil
elf
instructionAPI
parseAPI
patchAPI
proccontrol
stackwalk
symlite
symtabAPI
)
endif()

Expand Down Expand Up @@ -82,21 +71,10 @@ if(${SYMREADER} MATCHES symtabAPI)
add_subdirectory (dyninstAPI)
endif()

# Build the RT library as a seperate project so we can change compilers
message(STATUS "Configuring DyninstAPI_RT")
file(REMOVE_RECURSE ${RT_BINARY_DIR}/CMakeCache.txt ${RT_BINARY_DIR}/CMakeFiles ${RT_BINARY_DIR}/Makefile ${RT_BINARY_DIR}/Makefile)
file(MAKE_DIRECTORY ${RT_BINARY_DIR})
if (PLATFORM MATCHES bgq)
set (RT_C_COMPILER mpicc CACHE STRING "Compiler for runtime library")
else()
set (RT_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING "Compiler for runtime library")
endif()
set (ENABLE_STATIC_LIBS NO CACHE STRING "Build static libraries as well?")
message(STATUS "Configuring RT library")
if(BUILD_RTLIB)
# Build the RT library as a seperate project so we can change compilers
# Build the RT library as a separate project so we can change compilers
message(STATUS "Configuring DyninstAPI_RT")
file(REMOVE_RECURSE ${RT_BINARY_DIR}/CMakeCache.txt ${RT_BINARY_DIR}/CMakeFiles ${RT_BINARY_DIR}/Makefile ${RT_BINARY_DIR}/Makefile)
file(REMOVE_RECURSE ${RT_BINARY_DIR}/CMakeCache.txt ${RT_BINARY_DIR}/CMakeFiles ${RT_BINARY_DIR}/Makefile)
file(MAKE_DIRECTORY ${RT_BINARY_DIR})
if (PLATFORM MATCHES bgq)
set (RT_C_COMPILER mpicc CACHE STRING "Compiler for runtime library")
Expand All @@ -122,6 +100,7 @@ if(BUILD_RTLIB)

if(MSVC)
include_external_msproject(DyninstAPI_RT dyninstAPI_RT/dyninstAPI_RT.vcxproj)
include_external_msproject(DyninstAPI_RT_static dyninstAPI_RT/dyninstAPI_RT_static.vcxproj)
else()
add_custom_target(DyninstRT
ALL
Expand Down Expand Up @@ -173,7 +152,6 @@ if(BUILD_DOCS)
)
endforeach()

#set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
find_package(LATEX)
if(PDFLATEX_COMPILER)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/common/doc
Expand All @@ -183,11 +161,9 @@ if(BUILD_DOCS)
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT})
set (DEPS "")
file(GLOB_RECURSE DEPS ${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT}/doc/*.tex ${CMAKE_CURRENT_SOURCE_DIR}/common/doc/*.tex)
#message(STATUS "Found dependencies for ${COMPONENT} manual: ${DEPS}")
add_custom_command(
# OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT}/doc/${COMPONENT}.aux
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc/${COMPONENT}.aux
DEPENDS ${DEPS} #${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT}/doc/${COMPONENT}.tex
DEPENDS ${DEPS}
COMMAND ${PDFLATEX_COMPILER}
ARGS -interaction=batchmode ${COMPONENT}.tex
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc
Expand All @@ -196,20 +172,16 @@ if(BUILD_DOCS)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc/${COMPONENT}.log
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc/${COMPONENT}.aux
# OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT}/doc/${COMPONENT}.log
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT}/doc/${COMPONENT}.aux
COMMAND ${PDFLATEX_COMPILER}
ARGS -interaction=batchmode ${COMPONENT}.tex
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc
COMMENT "Latex (second pass)"
)
add_custom_target(${COMPONENT}-doc echo
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT}/doc/${COMPONENT}.log
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc/${COMPONENT}.log
)
add_dependencies(doc ${COMPONENT}-doc)
set_target_properties(${COMPONENT}-doc PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
#add_dependencies(${COMPONENT} ${COMPONENT}-doc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/doc/${COMPONENT}.pdf
DESTINATION ${INSTALL_DOC_DIR}
RENAME ${COMPONENT}-${VERSION_STRING}.pdf
Expand Down Expand Up @@ -248,3 +220,6 @@ if(UNIX)
endif()
endif()

if(TARGET boost)
add_dependencies(common boost)
endif()
46 changes: 34 additions & 12 deletions README → README.md
@@ -1,13 +1,34 @@
READ THIS FIRST: how to build DyninstAPI and its subcomponents
# Dyninst

1) Configuration
## Branch states

| Branch | Status | Notes |
| --------------------------------------- |:-------------:|:--------------------------------------------------:|
| master | stable | See below |
| arm64 | experimental | |

## Notes

* Known issues should have open issues associated with them.
* ARM64 support in Dataflow/ParseAPI is experimental and incomplete.
* PPC64/little endian support in read-level interfaces
(symtab, stackwalker, proccontrol) is experimental.
* PPC64/little endian support in write-level interfaces is not implemented.

All non-API-breaking bug fixes should land here. All non-ABI-breaking
bug fixes should also land on v9.2.x.

## Build DyninstAPI and its subcomponents

### Configuration

Dyninst is now built via CMake. We recommend performing an interactive
configuration with "ccmake ." first, in order to see which options are
relevant for your system. You may also perform a batch configuration
with "cmake .". Options are passed to CMake with -DVAR=VALUE. Common
options include:

```
Boost_INCLUDE_DIR
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX
Expand All @@ -16,6 +37,7 @@ LIBDWARF_LIBRARIES
LIBELF_INCLUDE_DIR
LIBELF_LIBRARIES
IBERTY_LIBRARIES
```

CMake's default generator on Linux is normally "Unix Makefiles", and
on Windows, it will normally produce project files for the most recent
Expand All @@ -34,23 +56,23 @@ manually define the appropriate compiler, library locations, include
locations, and the CROSS_COMPILING flag so that the build system will
properly evaluate what can be built and linked in your environment.

2) Building and installation
### Building and installing

To build Dyninst and all its components, "make && make install" from
the top-level directory of the source tree. To build and install a
single component and its dependencies, do the same thing from that
component's subdirectory. Libraries will be installed into
CMAKE_INSTALL_PREFIX/INSTALL_LIB_DIR, and headers will be installed
into CMAKE_INSTALL_PREFIX/INSTALL_INCLUDE_DIR. If you wish to import
`CMAKE_INSTALL_PREFIX/INSTALL_LIB_DIR`, and headers will be installed
into `CMAKE_INSTALL_PREFIX/INSTALL_INCLUDE_DIR`. If you wish to import
Dyninst into your own CMake projects, the export information is in
CMAKE_INSTALL_PREFIX/INSTALL_CMAKE_DIR. PDF documentation is included
and installed to CMAKE_INSTALL_PREFIX/INSTALL_DOC_DIR. If you update
`CMAKE_INSTALL_PREFIX/INSTALL_CMAKE_DIR`. PDF documentation is included
and installed to `CMAKE_INSTALL_PREFIX/INSTALL_DOC_DIR`. If you update
the LaTeX source documents for any manuals, "make doc" will rebuild
them. Components may be built and installed individually: "make
$COMPONENT" and "make $COMPONENT-install" respectively; this will
appropriately respect inter-component dependencies.

3) What's new
## What's new

NEW FEATURES:

Expand All @@ -63,7 +85,7 @@ NEW FEATURES:
* Initial ppc64/little endian support in Symtab, InstructionAPI, ProcControl, and Stackwalker. Add
-Darch_ppc64_little_endian to your CMake command line when building on little-endian ppc64 systems.

BUG FIXES
## Bug fixes

* PIE binaries should now be rewritten correctly, even if they have a zero base address

Expand All @@ -77,14 +99,14 @@ BUG FIXES

* Various proccontrol bug fixes

* RTlib's DYNINSTos_malloc and DYNINSTos_free should now be signal-safe
* RTlib's `DYNINSTos_malloc` and `DYNINSTos_free` should now be signal-safe

* RTlib's tramp guard lock/unlock functions should now avoid making implicit function calls
(which are unsafe from tramp guard code)

* ppc64 bit rot for create/attach modes is fixed

KNOWN ISSUES
## Known Issues

* ppc64 rewriter mode does not handle any code that does not conform to the "caller sets up TOC" model for intermodule
calls
Expand All @@ -105,4 +127,4 @@ the main thread of a process

* Stackwalker is fragile on Windows

* Parsing a binary with no functions (typically a single object file) will crash at CodeObject destruction time.
* Parsing a binary with no functions (typically a single object file) will crash at CodeObject destruction time.
15 changes: 15 additions & 0 deletions appveyor.yml
@@ -0,0 +1,15 @@
build:
parallel: true
project: Dyninst.sln
verbosity: normal

clone_depth: 5

platform:
- Win32

configuration:
- Release

before_build:
- cmake .

0 comments on commit c2c3348

Please sign in to comment.