1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
from spack import *
class Dyninst(CMakePackage):
"""API for dynamic binary instrumentation. Modify programs while they
are executing without recompiling, re-linking, or re-executing."""
homepage = "https://dyninst.org"
git = "https://github.com/dyninst/dyninst.git"
maintainers = ['hainest']
tags = ['e4s']
version('master', branch='master')
version('12.1.0', tag='v12.1.0')
version('12.0.1', tag='v12.0.1')
version('12.0.0', tag='v12.0.0')
version('11.0.1', tag='v11.0.1')
version('11.0.0', tag='v11.0.0')
version('10.2.1', tag='v10.2.1')
version('10.2.0', tag='v10.2.0')
version('10.1.0', tag='v10.1.0')
version('10.0.0', tag='v10.0.0')
version('9.3.2', tag='v9.3.2', deprecated=True)
version('9.3.0', tag='v9.3.0', deprecated=True)
version('9.2.0', tag='v9.2.0', deprecated=True)
version('9.1.0', tag='v9.1.0', deprecated=True)
version('8.2.1', tag='v8.2.1', deprecated=True)
variant('openmp', default=True,
description='Enable OpenMP support for ParseAPI '
'(version 10.0.0 or later)')
variant('static', default=False,
description='Build static libraries')
variant('stat_dysect', default=False,
description="Patch for STAT's DySectAPI")
boost_libs = '+atomic+chrono+date_time+filesystem+system+thread+timer'
'+container+random+exception'
depends_on('boost@1.61.0:' + boost_libs, when='@10.1.0:')
depends_on('boost@1.61.0:1.69' + boost_libs, when='@:10.0')
depends_on('boost@1.67.0:' + boost_libs, when='@11.0.0:')
depends_on('libiberty+pic')
# Dyninst uses elfutils starting with 9.3.0, and used libelf
# before that.
# NB: Parallel DWARF parsing in Dyninst 10.2.0 requires a thread-
# safe libdw
depends_on('elfutils@0.186:', type='link', when='@12.0.1:')
depends_on('elfutils@0.178:', type='link', when='@10.2.0:')
depends_on('elfutils', type='link', when='@9.3.0:10.1')
depends_on('libelf', type='link', when='@:9.2')
# Dyninst uses libdw from elfutils starting with 10.0, and used
# libdwarf before that.
depends_on('libdwarf', when='@:9')
depends_on('tbb@2018.6:', when='@10.0.0:')
depends_on('cmake@3.4.0:', type='build', when='@10.1.0:')
depends_on('cmake@3.0.0:', type='build', when='@10.0.0:10.0')
depends_on('cmake@2.8:', type='build', when='@:9')
patch('stat_dysect.patch', when='+stat_dysect')
patch('stackanalysis_h.patch', when='@9.2.0')
patch('v9.3.2-auto.patch', when='@9.3.2 %gcc@:4.7')
patch('tribool.patch', when='@9.3.0:10.0.0 ^boost@1.69:')
# No Mac support (including apple-clang)
conflicts('platform=darwin', msg='macOS is not supported')
# We currently only build with gcc
conflicts('%clang')
conflicts('%arm')
conflicts('%cce')
conflicts('%fj')
conflicts('%intel')
conflicts('%pgi')
conflicts('%xl')
conflicts('%xl_r')
# Version 11.0 requires a C++11-compliant ABI
conflicts('%gcc@:5', when='@11.0.0:')
# Versions 9.3.x used cotire, but have no knob to turn it off.
# Cotire has no real use for one-time builds and can break
# parallel builds with both static and shared libs.
@when('@9.3.0:9.3')
def patch(self):
filter_file('USE_COTIRE true', 'USE_COTIRE false',
'cmake/shared.cmake')
# New style cmake args, starting with 10.1.
@when('@10.1.0:')
def cmake_args(self):
spec = self.spec
args = [
'-DBoost_ROOT_DIR=%s' % spec['boost'].prefix,
'-DElfUtils_ROOT_DIR=%s' % spec['elf'].prefix,
'-DLibIberty_ROOT_DIR=%s' % spec['libiberty'].prefix,
'-DTBB_ROOT_DIR=%s' % spec['tbb'].prefix,
self.define('LibIberty_LIBRARIES', spec['libiberty'].libs)
]
if '+openmp' in spec:
args.append('-DUSE_OpenMP=ON')
else:
args.append('-DUSE_OpenMP=OFF')
if '+static' in spec:
args.append('-DENABLE_STATIC_LIBS=YES')
else:
args.append('-DENABLE_STATIC_LIBS=NO')
# Make sure Dyninst doesn't try to build its own dependencies
# outside of Spack
if spec.satisfies('@10.2.0:'):
args.append('-DSTERILE_BUILD=ON')
return args
# Old style cmake args, up through 10.0.
@when('@:10.0')
def cmake_args(self):
spec = self.spec
# Elf -- the directory containing libelf.h.
elf = spec['elf'].prefix
elf_include = os.path.dirname(
find_headers('libelf', elf.include, recursive=True)[0])
# Dwarf -- the directory containing elfutils/libdw.h or
# libdwarf.h, and the path to libdw.so or libdwarf.so.
if spec.satisfies('@10.0.0:'):
dwarf_include = elf.include
dwarf_lib = find_libraries('libdw', elf, recursive=True)
else:
dwarf_include = spec['libdwarf'].prefix.include
dwarf_lib = spec['libdwarf'].libs
args = [
'-DPATH_BOOST=%s' % spec['boost'].prefix,
'-DIBERTY_LIBRARIES=%s' % spec['libiberty'].libs,
'-DLIBELF_INCLUDE_DIR=%s' % elf_include,
'-DLIBELF_LIBRARIES=%s' % spec['elf'].libs,
'-DLIBDWARF_INCLUDE_DIR=%s' % dwarf_include,
'-DLIBDWARF_LIBRARIES=%s' % dwarf_lib,
]
# TBB include and lib directories, version 10.x or later.
if spec.satisfies('@10.0.0:'):
args.extend([
'-DTBB_INCLUDE_DIRS=%s' % spec['tbb'].prefix.include,
'-DTBB_LIBRARY=%s' % spec['tbb'].prefix.lib,
])
# Openmp applies to version 10.x or later.
if spec.satisfies('@10.0.0:'):
if '+openmp' in spec:
args.append('-DUSE_OpenMP=ON')
else:
args.append('-DUSE_OpenMP=OFF')
# Static libs started with version 9.1.0.
if spec.satisfies('@9.1.0:'):
if '+static' in spec:
args.append('-DENABLE_STATIC_LIBS=1')
else:
args.append('-DENABLE_STATIC_LIBS=NO')
return args
|