Skip to content

Commit

Permalink
Add Dyninst
Browse files Browse the repository at this point in the history
  • Loading branch information
blue42u authored and neheb committed Aug 21, 2024
1 parent d0b7919 commit a5cdf0b
Show file tree
Hide file tree
Showing 19 changed files with 1,578 additions and 0 deletions.
33 changes: 33 additions & 0 deletions ci_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,39 @@
"linux": false
}
},
"dyninst": {
"_comment": [
"- Linux only, Glibc only",
"- Warnings unavoidable, uses .C for C++ source files"
],
"build_on": {
"alpine": false,
"darwin": false,
"msys2": false,
"windows": false
},
"alpine_packages": [
"binutils-dev",
"boost-dev",
"elfutils-dev",
"onetbb-dev"
],
"debian_packages": [
"libboost-atomic-dev",
"libboost-chrono-dev",
"libboost-date-time-dev",
"libboost-filesystem-dev",
"libboost-system-dev",
"libboost-thread-dev",
"libboost-timer-dev",
"libdebuginfod-dev",
"libdw-dev",
"libelf-dev",
"libiberty-dev",
"libtbb-dev"
],
"fatal_warnings": false
},
"epoxy": {
"alpine_packages": [
"libx11-dev",
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,14 @@
"1.1.2-1"
]
},
"dyninst": {
"dependency_names": [
"dyninst"
],
"versions": [
"13.0.0-1"
]
},
"eigen": {
"dependency_names": [
"eigen3"
Expand Down
9 changes: 9 additions & 0 deletions subprojects/dyninst.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[wrap-file]
directory = dyninst-13.0.0
source_url = https://github.com/dyninst/dyninst/archive/refs/tags/v13.0.0.tar.gz
source_filename = dyninst-13.0.0.tar.gz
source_hash = 1bc48d26478b677a6c090c25586a447507bd1b4cf88d369bd61820005ce1be39
patch_directory = dyninst

[provide]
dyninst = dyninst_dep
60 changes: 60 additions & 0 deletions subprojects/packagefiles/dyninst/common/h/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
ver = meson.project_version().split('.')
configure_file(
output: 'dyninstversion.h',
input: version_h_in,
format: 'cmake',
install: true,
install_dir: get_option('includedir'),
configuration: {
'DYNINST_MAJOR_VERSION': ver[0].to_int().to_string(),
'DYNINST_MINOR_VERSION': ver[1].to_int().to_string(),
'DYNINST_PATCH_VERSION': ver[2].to_int().to_string(),
},
)

install_headers(
'Annotatable.h',
'Architecture.h',
'Buffer.h',
'compiler_annotations.h',
'compiler_diagnostics.h',
'concurrent.h',
'DynAST.h',
'dyn_regs.h',
'dyn_syscalls.h',
'dyntypes.h',
'Edge.h',
'entryIDs.h',
'Graph.h',
'IBSTree-fast.h',
'IBSTree.h',
'MachSyscall.h',
'mnemonics/aarch64_entryIDs.h',
'mnemonics/ppc_entryIDs.h',
'mnemonics/x86_entryIDs.h',
'mnemonics/AMDGPU/gfx908_entryIDs.h',
'mnemonics/AMDGPU/gfx90a_entryIDs.h',
'mnemonics/AMDGPU/gfx940_entryIDs.h',
'mnemonics/IntelGPU/generic_entryIDs.h',
'mnemonics/NVIDIA/generic_entryIDs.h',
'Node.h',
'ProcReader.h',
'registers/MachRegister.h',
'registers/aarch64_regs.h',
'registers/abstract_regs.h',
'registers/AMDGPU/amdgpu_gfx908_regs.h',
'registers/AMDGPU/amdgpu_gfx90a_regs.h',
'registers/AMDGPU/amdgpu_gfx940_regs.h',
'registers/cuda_regs.h',
'registers/MachRegister.h',
'registers/ppc32_regs.h',
'registers/ppc64_regs.h',
'registers/reg_def.h',
'registers/x86_64_regs.h',
'registers/x86_regs.h',
'SymReader.h',
'unaligned_memory_access.h',
'util.h',
'VariableLocation.h',
preserve_path: true,
)
83 changes: 83 additions & 0 deletions subprojects/packagefiles/dyninst/common/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
srcs = files(
'src/AST.C',
# The above file must be listed first to dodge an initialization order bug.
# See https://github.com/dyninst/dyninst/issues/1730
'src/Annotatable.C',
'src/Buffer.C',
'src/DOT.C',
'src/Edge.C',
'src/Graph.C',
'src/MachSyscall.C',
'src/MappedFile.C',
'src/Node.C',
'src/Timer.C',
'src/VariableLocation.C',
'src/addrtranslate.C',
'src/arch-aarch64.C',
'src/arch-power.C',
'src/arch-x86.C',
'src/concurrent.C',
'src/debug_common.C',
'src/dyn_regs.C',
'src/lprintf.C',
'src/pathName.C',
'src/pfq-rwlock.C',
'src/registers/MachRegister.C',
'src/sha1.C',
'src/stats.C',
'src/util.C',
)
args = []

if host_machine.system() in ['linux', 'freebsd']
srcs += files(
'src/addrtranslate-sysv.C',
'src/symbolDemangle.c',
'src/symbolDemangleWithCache.C',
)
endif

if host_machine.system() == 'freebsd'
srcs += files('src/addrtranslate-freebsd.C', 'src/freebsdKludges.C')
elif host_machine.system() == 'linux'
srcs += files(
'src/addrtranslate-auxv.C',
'src/addrtranslate-linux.C',
'src/linuxKludges.C',
'src/parseauxv.C',
)
elif host_machine.system() == 'windows'
srcs += files('src/addrtranslate-win.C', 'src/ntKludges.C')
args += ['-DWIN32', '-D_WIN32_WINNT=0x500']
endif

args += ['-DCOMMON_LIB']

subdir('h')

iface_deps = [boost_dep, tbb_dep]
common_lib = library(
'common',
srcs,
gnu_symbol_visibility: 'inlineshidden',
override_options: ['b_ndebug=false'],
include_directories: include_directories('..', 'src', 'h'),
c_args: args,
cpp_args: args,
dependencies: [
iface_deps,
libiberty_dep,
openmp_dep,
valgrind_dep,
threads_dep,
],
version: meson.project_version(),
soversion: dyninst_soversion,
install: true,
)
common_dep = declare_dependency(
link_with: common_lib,
include_directories: include_directories('h'),
dependencies: iface_deps,
)
all_deps += common_dep
48 changes: 48 additions & 0 deletions subprojects/packagefiles/dyninst/dwarf/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
if host_machine.system() not in ['linux', 'freebsd']
subdir_done()
endif

args = ['-DDYNDWARF_LIB']
srcs = files(
'src/dwarfExprParser.C',
'src/dwarfFrameParser.C',
'src/dwarfHandle.C',
'src/dwarfResult.C',
'src/dwarf_subrange.cpp',
)

install_headers(
'h/dwarfExprParser.h',
'h/dwarfFrameParser.h',
'h/dwarfHandle.h',
'h/dwarfResult.h',
'h/dwarf_unit_info.h',
)

iface_deps = [common_dep, dynelf_dep]
dynDwarf_lib = library(
'dynDwarf',
srcs,
gnu_symbol_visibility: 'inlineshidden',
override_options: ['b_ndebug=false'],
include_directories: include_directories(
'..',
'src',
'h',
# Come through hacky CMake target tricks
'../common/src',
'../elf/src',
),
c_args: args,
cpp_args: args,
dependencies: [iface_deps, libdw_dep],
version: meson.project_version(),
soversion: dyninst_soversion,
install: true,
)
dyndwarf_dep = declare_dependency(
link_with: dynDwarf_lib,
include_directories: include_directories('h'),
dependencies: iface_deps,
)
all_deps += dyndwarf_dep
47 changes: 47 additions & 0 deletions subprojects/packagefiles/dyninst/dynC_API/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
if get_option('lightweight_symtab')
message('-Dlightweight_symtab=true; dynC_API not built')
subdir_done()
endif

srcs = files(
'src/dynC.C',
'src/dynC.tab.C',
'src/lex.dynC.C',
'src/snippetGen.C',
)

args = ['-DDYNC_EXPORTS']
if host_machine.system() == 'windows'
args += ['-DYY_NO_UNISTD_H']
endif

install_headers('h/dynC.h', 'h/snippetGen.h')

iface_deps = [common_dep, dyninstapi_dep, symtabapi_dep]
dynC_lib = library(
'dynC_API',
srcs,
gnu_symbol_visibility: 'inlineshidden',
override_options: ['b_ndebug=false'],
include_directories: include_directories(
'..',
'src',
'h',
# Comes through hacky CMake target trickery
'../common/src',
'../dyninstAPI/src',
'../symtabAPI/src',
),
c_args: args,
cpp_args: args,
dependencies: [iface_deps],
version: meson.project_version(),
soversion: dyninst_soversion,
install: true,
)
dync_dep = declare_dependency(
link_with: dynC_lib,
include_directories: include_directories('h'),
dependencies: iface_deps,
)
all_deps += dync_dep
Loading

0 comments on commit a5cdf0b

Please sign in to comment.