frida 17.2.11 → 17.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/releng/deps.py +32 -21
- package/releng/deps.toml +33 -12
- package/releng/devkit.py +17 -4
- package/releng/env.py +12 -12
- package/releng/env_android.py +4 -4
- package/releng/env_apple.py +4 -4
- package/releng/env_generic.py +17 -11
- package/releng/frida_version.py +2 -1
- package/releng/machine_file.py +2 -2
- package/releng/machine_spec.py +5 -2
- package/releng/meson/mesonbuild/compilers/mixins/clike.py +1 -1
- package/releng/meson/mesonbuild/envconfig.py +6 -0
- package/releng/meson/mesonbuild/linkers/linkers.py +2 -1
- package/releng/meson_configure.py +12 -11
- package/releng/meson_make.py +3 -3
- package/releng/mkdevkit.py +21 -7
- package/releng/winenv.py +5 -5
- package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
- package/subprojects/frida-core.wrap +1 -1
package/package.json
CHANGED
package/releng/deps.py
CHANGED
|
@@ -19,7 +19,7 @@ import sys
|
|
|
19
19
|
import tarfile
|
|
20
20
|
import tempfile
|
|
21
21
|
import time
|
|
22
|
-
from typing import Callable, Iterator, Optional, Mapping, Sequence, Union
|
|
22
|
+
from typing import Callable, Dict, Iterator, List, Optional, Mapping, Sequence, Set, Tuple, Union
|
|
23
23
|
import urllib.request
|
|
24
24
|
|
|
25
25
|
RELENG_DIR = Path(__file__).resolve().parent
|
|
@@ -107,7 +107,7 @@ def parse_bundle_option_value(raw_bundle: str) -> Bundle:
|
|
|
107
107
|
raise argparse.ArgumentTypeError(f"invalid choice: {raw_bundle} (choose from '{choices}')")
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
def parse_set_option_value(v: str) ->
|
|
110
|
+
def parse_set_option_value(v: str) -> Set[str]:
|
|
111
111
|
return set([v.strip() for v in v.split(",")])
|
|
112
112
|
|
|
113
113
|
|
|
@@ -123,7 +123,7 @@ def query_toolchain_prefix(machine: MachineSpec,
|
|
|
123
123
|
def ensure_toolchain(machine: MachineSpec,
|
|
124
124
|
cache_dir: Path,
|
|
125
125
|
version: Optional[str] = None,
|
|
126
|
-
on_progress: ProgressCallback = print_progress) ->
|
|
126
|
+
on_progress: ProgressCallback = print_progress) -> Tuple[Path, SourceState]:
|
|
127
127
|
toolchain_prefix = query_toolchain_prefix(machine, cache_dir)
|
|
128
128
|
state = sync(Bundle.TOOLCHAIN, machine, toolchain_prefix, version, on_progress)
|
|
129
129
|
return (toolchain_prefix, state)
|
|
@@ -137,7 +137,7 @@ def query_sdk_prefix(machine: MachineSpec,
|
|
|
137
137
|
def ensure_sdk(machine: MachineSpec,
|
|
138
138
|
cache_dir: Path,
|
|
139
139
|
version: Optional[str] = None,
|
|
140
|
-
on_progress: ProgressCallback = print_progress) ->
|
|
140
|
+
on_progress: ProgressCallback = print_progress) -> Tuple[Path, SourceState]:
|
|
141
141
|
sdk_prefix = query_sdk_prefix(machine, cache_dir)
|
|
142
142
|
state = sync(Bundle.SDK, machine, sdk_prefix, version, on_progress)
|
|
143
143
|
return (sdk_prefix, state)
|
|
@@ -283,8 +283,8 @@ def roll(bundle: Bundle,
|
|
|
283
283
|
def build(bundle: Bundle,
|
|
284
284
|
build_machine: MachineSpec,
|
|
285
285
|
host_machine: MachineSpec,
|
|
286
|
-
only_packages: Optional[
|
|
287
|
-
excluded_packages:
|
|
286
|
+
only_packages: Optional[Set[str]] = None,
|
|
287
|
+
excluded_packages: Set[str] = set(),
|
|
288
288
|
verbose: bool = False) -> Path:
|
|
289
289
|
builder = Builder(bundle, build_machine, host_machine, verbose)
|
|
290
290
|
try:
|
|
@@ -317,15 +317,15 @@ class Builder:
|
|
|
317
317
|
self._toolchain_prefix: Optional[Path] = None
|
|
318
318
|
self._build_config: Optional[env.MachineConfig] = None
|
|
319
319
|
self._host_config: Optional[env.MachineConfig] = None
|
|
320
|
-
self._build_env:
|
|
321
|
-
self._host_env:
|
|
320
|
+
self._build_env: Dict[str, str] = {}
|
|
321
|
+
self._host_env: Dict[str, str] = {}
|
|
322
322
|
|
|
323
323
|
self._ansi_supported = os.environ.get("TERM") != "dumb" \
|
|
324
324
|
and (self._build_machine.os != "windows" or "WT_SESSION" in os.environ)
|
|
325
325
|
|
|
326
326
|
def build(self,
|
|
327
|
-
only_packages: Optional[
|
|
328
|
-
excluded_packages:
|
|
327
|
+
only_packages: Optional[List[str]],
|
|
328
|
+
excluded_packages: Set[str]) -> Path:
|
|
329
329
|
started_at = time.time()
|
|
330
330
|
prepare_ended_at = None
|
|
331
331
|
clone_time_elapsed = None
|
|
@@ -407,7 +407,7 @@ class Builder:
|
|
|
407
407
|
|
|
408
408
|
def _resolve_dependencies(self,
|
|
409
409
|
packages: Sequence[PackageSpec],
|
|
410
|
-
all_packages: Mapping[str, PackageSpec]) ->
|
|
410
|
+
all_packages: Mapping[str, PackageSpec]) -> Dict[str, PackageSpec]:
|
|
411
411
|
result = {p.identifier: p for p in packages}
|
|
412
412
|
for p in packages:
|
|
413
413
|
self._resolve_package_dependencies(p, all_packages, result)
|
|
@@ -454,7 +454,7 @@ class Builder:
|
|
|
454
454
|
symfile = envdir / "toolchain-executable.symbols"
|
|
455
455
|
symfile.write_text("# No exported symbols.\n", encoding="utf-8")
|
|
456
456
|
extra_ldflags += [f"-Wl,-exported_symbols_list,{symfile}"]
|
|
457
|
-
elif self._host_machine.os
|
|
457
|
+
elif self._host_machine.os == "freebsd":
|
|
458
458
|
verfile = envdir / "toolchain-executable.version"
|
|
459
459
|
verfile.write_text("\n".join([
|
|
460
460
|
"{",
|
|
@@ -470,6 +470,17 @@ class Builder:
|
|
|
470
470
|
]),
|
|
471
471
|
encoding="utf-8")
|
|
472
472
|
extra_ldflags += [f"-Wl,--version-script,{verfile}"]
|
|
473
|
+
elif self._host_machine.os != "windows":
|
|
474
|
+
verfile = envdir / "toolchain-executable.version"
|
|
475
|
+
verfile.write_text("\n".join([
|
|
476
|
+
"{",
|
|
477
|
+
" local:",
|
|
478
|
+
" *;",
|
|
479
|
+
"};",
|
|
480
|
+
""
|
|
481
|
+
]),
|
|
482
|
+
encoding="utf-8")
|
|
483
|
+
extra_ldflags += [f"-Wl,--version-script,{verfile}"]
|
|
473
484
|
if extra_ldflags:
|
|
474
485
|
menv["LDFLAGS"] = shlex.join(extra_ldflags + shlex.split(menv.get("LDFLAGS", "")))
|
|
475
486
|
|
|
@@ -627,7 +638,7 @@ class Builder:
|
|
|
627
638
|
|
|
628
639
|
return outfile
|
|
629
640
|
|
|
630
|
-
def _stage_toolchain_files(self, location: Path) ->
|
|
641
|
+
def _stage_toolchain_files(self, location: Path) -> List[Path]:
|
|
631
642
|
if self._host_machine.os == "windows":
|
|
632
643
|
toolchain_prefix = self._toolchain_prefix
|
|
633
644
|
mixin_files = [f for f in self._walk_plain_files(toolchain_prefix)
|
|
@@ -639,7 +650,7 @@ class Builder:
|
|
|
639
650
|
if self._file_is_toolchain_related(f)]
|
|
640
651
|
copy_files(prefix, files, location)
|
|
641
652
|
|
|
642
|
-
def _stage_sdk_files(self, location: Path) ->
|
|
653
|
+
def _stage_sdk_files(self, location: Path) -> List[Path]:
|
|
643
654
|
prefix = self._get_prefix(self._host_machine)
|
|
644
655
|
files = [f for f in self._walk_plain_files(prefix)
|
|
645
656
|
if self._file_is_sdk_related(f)]
|
|
@@ -846,7 +857,7 @@ def wait(bundle: Bundle, machine: MachineSpec):
|
|
|
846
857
|
|
|
847
858
|
|
|
848
859
|
def bump():
|
|
849
|
-
def run(argv:
|
|
860
|
+
def run(argv: List[str], **kwargs) -> subprocess.CompletedProcess:
|
|
850
861
|
return subprocess.run(argv,
|
|
851
862
|
capture_output=True,
|
|
852
863
|
encoding="utf-8",
|
|
@@ -901,7 +912,7 @@ def bump_wraps(identifier: str,
|
|
|
901
912
|
print(f"\tno relevant wraps, only: {', '.join([blob['path'] for blob, _ in all_wraps])}")
|
|
902
913
|
return
|
|
903
914
|
|
|
904
|
-
pending_wraps:
|
|
915
|
+
pending_wraps: List[Tuple[str, str, PackageSpec]] = []
|
|
905
916
|
for blob, spec in relevant_wraps:
|
|
906
917
|
filename = blob["path"]
|
|
907
918
|
|
|
@@ -965,7 +976,7 @@ def identifier_from_wrap_filename(filename: str) -> str:
|
|
|
965
976
|
|
|
966
977
|
def compute_bundle_parameters(bundle: Bundle,
|
|
967
978
|
machine: MachineSpec,
|
|
968
|
-
version: str) ->
|
|
979
|
+
version: str) -> Tuple[str, str]:
|
|
969
980
|
if bundle == Bundle.TOOLCHAIN and machine.os == "windows":
|
|
970
981
|
os_arch_config = "windows-x86" if machine.arch in {"x86", "x86_64"} else machine.os_dash_arch
|
|
971
982
|
else:
|
|
@@ -1061,7 +1072,7 @@ def parse_dependency(v: Union[str, dict]) -> OptionSpec:
|
|
|
1061
1072
|
|
|
1062
1073
|
|
|
1063
1074
|
def copy_files(fromdir: Path,
|
|
1064
|
-
files:
|
|
1075
|
+
files: List[Path],
|
|
1065
1076
|
todir: Path):
|
|
1066
1077
|
for filename in files:
|
|
1067
1078
|
src = fromdir / filename
|
|
@@ -1103,7 +1114,7 @@ class SourceState(Enum):
|
|
|
1103
1114
|
class DependencyParameters:
|
|
1104
1115
|
deps_version: str
|
|
1105
1116
|
bootstrap_version: str
|
|
1106
|
-
packages:
|
|
1117
|
+
packages: Dict[str, PackageSpec]
|
|
1107
1118
|
|
|
1108
1119
|
|
|
1109
1120
|
@dataclass
|
|
@@ -1112,8 +1123,8 @@ class PackageSpec:
|
|
|
1112
1123
|
name: str
|
|
1113
1124
|
version: str
|
|
1114
1125
|
url: str
|
|
1115
|
-
options:
|
|
1116
|
-
dependencies:
|
|
1126
|
+
options: List[OptionSpec] = field(default_factory=list)
|
|
1127
|
+
dependencies: List[DependencySpec] = field(default_factory=list)
|
|
1117
1128
|
scope: Optional[str] = None
|
|
1118
1129
|
when: Optional[str] = None
|
|
1119
1130
|
|
package/releng/deps.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[dependencies]
|
|
2
|
-
version = "
|
|
3
|
-
bootstrap_version = "
|
|
2
|
+
version = "20250718"
|
|
3
|
+
bootstrap_version = "20250512"
|
|
4
4
|
|
|
5
5
|
[ninja]
|
|
6
6
|
scope = "toolchain"
|
|
@@ -20,7 +20,7 @@ dependencies = [
|
|
|
20
20
|
[vala]
|
|
21
21
|
scope = "toolchain"
|
|
22
22
|
name = "Vala"
|
|
23
|
-
version = "
|
|
23
|
+
version = "9feabf0f8076c33b702d7cba612edfe0c1e45a00"
|
|
24
24
|
url = "https://github.com/frida/vala.git"
|
|
25
25
|
dependencies = [
|
|
26
26
|
"glib",
|
|
@@ -32,7 +32,7 @@ dependencies = [
|
|
|
32
32
|
# We use Apple's implementation in toolchains to make them smaller.
|
|
33
33
|
when = """ \
|
|
34
34
|
(machine.is_apple and bundle is Bundle.SDK) \
|
|
35
|
-
or machine.os in {'android', 'qnx'} \
|
|
35
|
+
or machine.os in {'android', 'qnx', 'none'} \
|
|
36
36
|
or machine.config == 'uclibc' \
|
|
37
37
|
"""
|
|
38
38
|
name = "libiconv"
|
|
@@ -73,7 +73,7 @@ options = [
|
|
|
73
73
|
|
|
74
74
|
[glib]
|
|
75
75
|
name = "GLib"
|
|
76
|
-
version = "
|
|
76
|
+
version = "86b3f5fe2ebaa2f1c1954e7c28fdffb6db7c6e35"
|
|
77
77
|
url = "https://github.com/frida/glib.git"
|
|
78
78
|
options = [
|
|
79
79
|
"-Dcocoa=disabled",
|
|
@@ -87,7 +87,7 @@ options = [
|
|
|
87
87
|
{ value = "-Dglib_checks=false", when = "machine.config_is_optimized" },
|
|
88
88
|
{ value = "-Diconv=external", when = """ \
|
|
89
89
|
machine.is_apple \
|
|
90
|
-
or machine.os in {'android', 'qnx'} \
|
|
90
|
+
or machine.os in {'android', 'qnx', 'none'} \
|
|
91
91
|
or machine.config == 'uclibc' \
|
|
92
92
|
""" }
|
|
93
93
|
]
|
|
@@ -97,7 +97,7 @@ dependencies = [
|
|
|
97
97
|
"zlib",
|
|
98
98
|
{ id = "libiconv", when = """ \
|
|
99
99
|
(machine.is_apple and bundle is Bundle.SDK) \
|
|
100
|
-
or machine.os in {'android', 'qnx'} \
|
|
100
|
+
or machine.os in {'android', 'qnx', 'none'} \
|
|
101
101
|
or machine.config == 'uclibc' \
|
|
102
102
|
""" }
|
|
103
103
|
]
|
|
@@ -112,6 +112,7 @@ options = [
|
|
|
112
112
|
]
|
|
113
113
|
|
|
114
114
|
[xz]
|
|
115
|
+
when = "machine.os != 'none'"
|
|
115
116
|
name = "XZ Utils"
|
|
116
117
|
version = "e70f5800ab5001c9509d374dbf3e7e6b866c43fe"
|
|
117
118
|
url = "https://github.com/frida/xz.git"
|
|
@@ -120,11 +121,18 @@ options = [
|
|
|
120
121
|
]
|
|
121
122
|
|
|
122
123
|
[brotli]
|
|
124
|
+
when = "machine.os != 'none'"
|
|
123
125
|
name = "Brotli"
|
|
124
126
|
version = "01d9e2922ca878965ebcd71ee8965d2a7aadb47a"
|
|
125
127
|
url = "https://github.com/frida/brotli.git"
|
|
126
128
|
|
|
129
|
+
[lzfse]
|
|
130
|
+
name = "LZFSE"
|
|
131
|
+
version = "5cfb7c86919d3c2c636d0d7552b51855a611ba1c"
|
|
132
|
+
url = "https://github.com/frida/lzfse.git"
|
|
133
|
+
|
|
127
134
|
[minizip-ng]
|
|
135
|
+
when = "machine.os != 'none'"
|
|
128
136
|
name = "minizip-ng"
|
|
129
137
|
version = "dfc1ccc070ff7bb50726c80215cac515253a8ba0"
|
|
130
138
|
url = "https://github.com/frida/minizip-ng.git"
|
|
@@ -142,6 +150,7 @@ dependencies = [
|
|
|
142
150
|
]
|
|
143
151
|
|
|
144
152
|
[sqlite]
|
|
153
|
+
when = "machine.os != 'none'"
|
|
145
154
|
name = "SQLite"
|
|
146
155
|
version = "9337327a50008f2d2236112ccb6f44059b1bafbd"
|
|
147
156
|
url = "https://github.com/frida/sqlite.git"
|
|
@@ -166,6 +175,7 @@ dependencies = [
|
|
|
166
175
|
]
|
|
167
176
|
|
|
168
177
|
[glib-networking]
|
|
178
|
+
when = "machine.os != 'none'"
|
|
169
179
|
name = "glib-networking"
|
|
170
180
|
version = "af4b017028e695528951c749a7096e96359521d8"
|
|
171
181
|
url = "https://github.com/frida/glib-networking.git"
|
|
@@ -182,6 +192,7 @@ dependencies = [
|
|
|
182
192
|
]
|
|
183
193
|
|
|
184
194
|
[libnice]
|
|
195
|
+
when = "machine.os != 'none'"
|
|
185
196
|
name = "libnice"
|
|
186
197
|
version = "e12567b0a16a0c2eb5dfe5e0782baba8496772ff"
|
|
187
198
|
url = "https://github.com/frida/libnice.git"
|
|
@@ -205,8 +216,9 @@ version = "ffff4bdfe8faa38cecfad5aab106cae923502d55"
|
|
|
205
216
|
url = "https://github.com/frida/libusb.git"
|
|
206
217
|
|
|
207
218
|
[lwip]
|
|
219
|
+
when = "machine.os != 'none'"
|
|
208
220
|
name = "lwIP"
|
|
209
|
-
version = "
|
|
221
|
+
version = "13fb5e0f519cc46dc4cd938808430f60a73f03d4"
|
|
210
222
|
url = "https://github.com/frida/lwip.git"
|
|
211
223
|
options = [
|
|
212
224
|
"-Dipv4=disabled",
|
|
@@ -224,6 +236,7 @@ dependencies = [
|
|
|
224
236
|
]
|
|
225
237
|
|
|
226
238
|
[usrsctp]
|
|
239
|
+
when = "machine.os != 'none'"
|
|
227
240
|
name = "usrsctp"
|
|
228
241
|
version = "f459ae9d3700c06e59d709901e92c08e31c6e623"
|
|
229
242
|
url = "https://github.com/frida/usrsctp.git"
|
|
@@ -234,6 +247,7 @@ options = [
|
|
|
234
247
|
]
|
|
235
248
|
|
|
236
249
|
[libgee]
|
|
250
|
+
when = "machine.os != 'none'"
|
|
237
251
|
name = "libgee"
|
|
238
252
|
version = "ad17ed847039469fcc2dc711ecfee2bbf7d2bf87"
|
|
239
253
|
url = "https://github.com/frida/libgee.git"
|
|
@@ -247,7 +261,7 @@ dependencies = [
|
|
|
247
261
|
|
|
248
262
|
[json-glib]
|
|
249
263
|
name = "JSON-GLib"
|
|
250
|
-
version = "
|
|
264
|
+
version = "ae19eff63b9c141112e8f1e2524852dda0010404"
|
|
251
265
|
url = "https://github.com/frida/json-glib.git"
|
|
252
266
|
options = [
|
|
253
267
|
"-Dintrospection=disabled",
|
|
@@ -260,6 +274,7 @@ dependencies = [
|
|
|
260
274
|
]
|
|
261
275
|
|
|
262
276
|
[libpsl]
|
|
277
|
+
when = "machine.os != 'none'"
|
|
263
278
|
name = "libpsl"
|
|
264
279
|
version = "b76c0fed2e27353d5fbb067ecdfdf76d2281eb91"
|
|
265
280
|
url = "https://github.com/frida/libpsl.git"
|
|
@@ -270,6 +285,7 @@ options = [
|
|
|
270
285
|
]
|
|
271
286
|
|
|
272
287
|
[libxml2]
|
|
288
|
+
when = "machine.os != 'none'"
|
|
273
289
|
name = "libxml2"
|
|
274
290
|
version = "f09ad5551829b7f2df3666759e701644a0ea8558"
|
|
275
291
|
url = "https://github.com/frida/libxml2.git"
|
|
@@ -280,6 +296,7 @@ options = [
|
|
|
280
296
|
]
|
|
281
297
|
|
|
282
298
|
[ngtcp2]
|
|
299
|
+
when = "machine.os != 'none'"
|
|
283
300
|
name = "ngtcp2"
|
|
284
301
|
version = "828dcaed498b40954e1b496664a3309796968db6"
|
|
285
302
|
url = "https://github.com/frida/ngtcp2.git"
|
|
@@ -288,11 +305,13 @@ dependencies = [
|
|
|
288
305
|
]
|
|
289
306
|
|
|
290
307
|
[nghttp2]
|
|
308
|
+
when = "machine.os != 'none'"
|
|
291
309
|
name = "nghttp2"
|
|
292
310
|
version = "ae13d24ea59c30e36ca53d1b22c4e664588d0445"
|
|
293
311
|
url = "https://github.com/frida/nghttp2.git"
|
|
294
312
|
|
|
295
313
|
[libsoup]
|
|
314
|
+
when = "machine.os != 'none'"
|
|
296
315
|
name = "libsoup"
|
|
297
316
|
version = "80dc080951c9037aef51a40ffbe4508d3ce98d1b"
|
|
298
317
|
url = "https://github.com/frida/libsoup.git"
|
|
@@ -329,13 +348,14 @@ options = [
|
|
|
329
348
|
|
|
330
349
|
[quickjs]
|
|
331
350
|
name = "QuickJS"
|
|
332
|
-
version = "
|
|
351
|
+
version = "f48e71e5240106dbca136e60f751e206d15cdb3f"
|
|
333
352
|
url = "https://github.com/frida/quickjs.git"
|
|
334
353
|
options = [
|
|
335
354
|
"-Dlibc=false",
|
|
336
355
|
"-Dbignum=true",
|
|
337
356
|
"-Datomics=disabled",
|
|
338
357
|
"-Dstack_check=disabled",
|
|
358
|
+
{ value = "-Dstack_mode=optimize", when = "machine.os == 'none'" },
|
|
339
359
|
]
|
|
340
360
|
|
|
341
361
|
[tinycc]
|
|
@@ -347,10 +367,11 @@ when = """ \
|
|
|
347
367
|
} \
|
|
348
368
|
"""
|
|
349
369
|
name = "TinyCC"
|
|
350
|
-
version = "
|
|
370
|
+
version = "517aa684db053997a9a5b4b57a8a210007e2b1c4"
|
|
351
371
|
url = "https://github.com/frida/tinycc.git"
|
|
352
372
|
|
|
353
373
|
[openssl]
|
|
374
|
+
when = "machine.os != 'none'"
|
|
354
375
|
name = "OpenSSL"
|
|
355
376
|
version = "7b86cb6a0c5cb9d79dca012c98a0a30a58eef5b5"
|
|
356
377
|
url = "https://github.com/frida/openssl.git"
|
|
@@ -365,7 +386,7 @@ when = """ \
|
|
|
365
386
|
and machine.arch != 'arm64beilp32' \
|
|
366
387
|
and not machine.arch.startswith('mips') \
|
|
367
388
|
and not machine.arch.startswith('powerpc') \
|
|
368
|
-
and machine.os
|
|
389
|
+
and machine.os not in {'none', 'qnx'} \
|
|
369
390
|
"""
|
|
370
391
|
name = "V8"
|
|
371
392
|
version = "990fdb00e1506126019493dd3bda4d416c81eaee"
|
package/releng/devkit.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from collections import OrderedDict
|
|
2
|
+
from enum import Enum
|
|
2
3
|
import itertools
|
|
3
4
|
import locale
|
|
4
5
|
import os
|
|
@@ -27,12 +28,18 @@ ASSETS_PATH = Path(__file__).parent / "devkit-assets"
|
|
|
27
28
|
INCLUDE_PATTERN = re.compile(r"#include\s+[<\"](.*?)[>\"]")
|
|
28
29
|
|
|
29
30
|
|
|
31
|
+
class DepSymbolScope(str, Enum):
|
|
32
|
+
PREFIXED = "prefixed"
|
|
33
|
+
ORIGINAL = "original"
|
|
34
|
+
|
|
35
|
+
|
|
30
36
|
class CompilerApplication:
|
|
31
37
|
def __init__(self,
|
|
32
38
|
kit: str,
|
|
33
39
|
machine: MachineSpec,
|
|
34
40
|
meson_config: Mapping[str, Union[str, Sequence[str]]],
|
|
35
|
-
output_dir: Path
|
|
41
|
+
output_dir: Path,
|
|
42
|
+
dep_symbol_scope: DepSymbolScope = DepSymbolScope.PREFIXED):
|
|
36
43
|
self.kit = kit
|
|
37
44
|
package, umbrella_header = DEVKITS[kit]
|
|
38
45
|
self.package = package
|
|
@@ -42,6 +49,7 @@ class CompilerApplication:
|
|
|
42
49
|
self.meson_config = meson_config
|
|
43
50
|
self.compiler_argument_syntax = None
|
|
44
51
|
self.output_dir = output_dir
|
|
52
|
+
self.dep_symbol_scope = dep_symbol_scope
|
|
45
53
|
self.library_filename = None
|
|
46
54
|
|
|
47
55
|
def run(self):
|
|
@@ -131,7 +139,13 @@ class CompilerApplication:
|
|
|
131
139
|
umbrella_header = header_files[0]
|
|
132
140
|
processed_header_files = {umbrella_header}
|
|
133
141
|
ingest_header(umbrella_header, header_files, processed_header_files, devkit_header_lines)
|
|
134
|
-
if kit
|
|
142
|
+
if kit in {"frida-gum", "frida-gumjs"} and machine.os == "none":
|
|
143
|
+
gum_dir = umbrella_header_path.parent
|
|
144
|
+
if kit == "frida-gumjs":
|
|
145
|
+
gum_dir = gum_dir.parent.parent / "gum"
|
|
146
|
+
barebone_header = gum_dir / "backend-barebone" / "include" / "gum" / "gumbarebone.h"
|
|
147
|
+
ingest_header(barebone_header, header_files, processed_header_files, devkit_header_lines)
|
|
148
|
+
if kit == "frida-gumjs" and machine.os != "none":
|
|
135
149
|
inspector_server_header = umbrella_header_path.parent / "guminspectorserver.h"
|
|
136
150
|
ingest_header(inspector_server_header, header_files, processed_header_files, devkit_header_lines)
|
|
137
151
|
if kit == "frida-core" and machine.os == "android":
|
|
@@ -263,9 +277,8 @@ class CompilerApplication:
|
|
|
263
277
|
shutil.rmtree(combined_dir)
|
|
264
278
|
|
|
265
279
|
objcopy = meson_config.get("objcopy", None)
|
|
266
|
-
if objcopy is not None:
|
|
280
|
+
if self.dep_symbol_scope is DepSymbolScope.PREFIXED and objcopy is not None:
|
|
267
281
|
thirdparty_symbol_mappings = get_thirdparty_symbol_mappings(output_path, meson_config)
|
|
268
|
-
|
|
269
282
|
renames = "\n".join([f"{original} {renamed}" for original, renamed in thirdparty_symbol_mappings]) + "\n"
|
|
270
283
|
with tempfile.NamedTemporaryFile() as renames_file:
|
|
271
284
|
renames_file.write(renames.encode("utf-8"))
|
package/releng/env.py
CHANGED
|
@@ -9,7 +9,7 @@ import shlex
|
|
|
9
9
|
import shutil
|
|
10
10
|
import subprocess
|
|
11
11
|
import sys
|
|
12
|
-
from typing import Callable, Literal, Optional
|
|
12
|
+
from typing import Callable, Dict, List, Literal, Optional, Tuple
|
|
13
13
|
|
|
14
14
|
from . import env_android, env_apple, env_generic, machine_file
|
|
15
15
|
from .machine_file import bool_to_meson, str_to_meson, strv_to_meson
|
|
@@ -19,10 +19,10 @@ from .machine_spec import MachineSpec
|
|
|
19
19
|
@dataclass
|
|
20
20
|
class MachineConfig:
|
|
21
21
|
machine_file: Path
|
|
22
|
-
binpath:
|
|
23
|
-
environ:
|
|
22
|
+
binpath: List[Path]
|
|
23
|
+
environ: Dict[str, str]
|
|
24
24
|
|
|
25
|
-
def make_merged_environment(self, source_environ:
|
|
25
|
+
def make_merged_environment(self, source_environ: Dict[str, str]) -> Dict[str, str]:
|
|
26
26
|
menv = {**source_environ}
|
|
27
27
|
menv.update(self.environ)
|
|
28
28
|
|
|
@@ -63,13 +63,13 @@ def detect_default_prefix() -> Path:
|
|
|
63
63
|
|
|
64
64
|
def generate_machine_configs(build_machine: MachineSpec,
|
|
65
65
|
host_machine: MachineSpec,
|
|
66
|
-
environ:
|
|
66
|
+
environ: Dict[str, str],
|
|
67
67
|
toolchain_prefix: Optional[Path],
|
|
68
68
|
build_sdk_prefix: Optional[Path],
|
|
69
69
|
host_sdk_prefix: Optional[Path],
|
|
70
70
|
call_selected_meson: Callable,
|
|
71
71
|
default_library: DefaultLibrary,
|
|
72
|
-
outdir: Path) ->
|
|
72
|
+
outdir: Path) -> Tuple[MachineConfig, MachineConfig]:
|
|
73
73
|
is_cross_build = host_machine != build_machine
|
|
74
74
|
|
|
75
75
|
if is_cross_build:
|
|
@@ -107,7 +107,7 @@ def generate_machine_configs(build_machine: MachineSpec,
|
|
|
107
107
|
def generate_machine_config(machine: MachineSpec,
|
|
108
108
|
build_machine: MachineSpec,
|
|
109
109
|
is_cross_build: bool,
|
|
110
|
-
environ:
|
|
110
|
+
environ: Dict[str, str],
|
|
111
111
|
toolchain_prefix: Optional[Path],
|
|
112
112
|
sdk_prefix: Optional[Path],
|
|
113
113
|
call_selected_meson: Callable,
|
|
@@ -249,13 +249,13 @@ def generate_machine_config(machine: MachineSpec,
|
|
|
249
249
|
|
|
250
250
|
def needs_exe_wrapper(build_machine: MachineSpec,
|
|
251
251
|
host_machine: MachineSpec,
|
|
252
|
-
environ:
|
|
252
|
+
environ: Dict[str, str]) -> bool:
|
|
253
253
|
return not can_run_host_binaries(build_machine, host_machine, environ)
|
|
254
254
|
|
|
255
255
|
|
|
256
256
|
def can_run_host_binaries(build_machine: MachineSpec,
|
|
257
257
|
host_machine: MachineSpec,
|
|
258
|
-
environ:
|
|
258
|
+
environ: Dict[str, str]) -> bool:
|
|
259
259
|
if host_machine == build_machine:
|
|
260
260
|
return True
|
|
261
261
|
|
|
@@ -281,7 +281,7 @@ def can_run_host_binaries(build_machine: MachineSpec,
|
|
|
281
281
|
|
|
282
282
|
|
|
283
283
|
def find_exe_wrapper(machine: MachineSpec,
|
|
284
|
-
environ:
|
|
284
|
+
environ: Dict[str, str]) -> Optional[List[str]]:
|
|
285
285
|
if machine.arch == "arm64beilp32":
|
|
286
286
|
return None
|
|
287
287
|
|
|
@@ -297,7 +297,7 @@ def find_exe_wrapper(machine: MachineSpec,
|
|
|
297
297
|
return [qemu_binary, "-L", qemu_sysroot]
|
|
298
298
|
|
|
299
299
|
|
|
300
|
-
def make_pkg_config_wrapper(pkg_config:
|
|
300
|
+
def make_pkg_config_wrapper(pkg_config: List[str], pkg_config_path: List[str]) -> str:
|
|
301
301
|
return "\n".join([
|
|
302
302
|
"import os",
|
|
303
303
|
"import subprocess",
|
|
@@ -317,7 +317,7 @@ def make_pkg_config_wrapper(pkg_config: list[str], pkg_config_path: list[str]) -
|
|
|
317
317
|
|
|
318
318
|
|
|
319
319
|
def detect_toolchain_vala_compiler(toolchain_prefix: Path,
|
|
320
|
-
build_machine: MachineSpec) -> Optional[
|
|
320
|
+
build_machine: MachineSpec) -> Optional[Tuple[Path, Path]]:
|
|
321
321
|
datadir = next((toolchain_prefix / "share").glob("vala-*"), None)
|
|
322
322
|
if datadir is None:
|
|
323
323
|
return None
|
package/releng/env_android.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from configparser import ConfigParser
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
import shlex
|
|
4
|
-
from typing import Callable, Optional
|
|
4
|
+
from typing import Callable, Dict, List, Optional
|
|
5
5
|
|
|
6
6
|
from .machine_file import strv_to_meson
|
|
7
7
|
from .machine_spec import MachineSpec
|
|
@@ -10,13 +10,13 @@ from .machine_spec import MachineSpec
|
|
|
10
10
|
def init_machine_config(machine: MachineSpec,
|
|
11
11
|
build_machine: MachineSpec,
|
|
12
12
|
is_cross_build: bool,
|
|
13
|
-
environ:
|
|
13
|
+
environ: Dict[str, str],
|
|
14
14
|
toolchain_prefix: Optional[Path],
|
|
15
15
|
sdk_prefix: Optional[Path],
|
|
16
16
|
call_selected_meson: Callable,
|
|
17
17
|
config: ConfigParser,
|
|
18
|
-
outpath:
|
|
19
|
-
outenv:
|
|
18
|
+
outpath: List[str],
|
|
19
|
+
outenv: Dict[str, str],
|
|
20
20
|
outdir: Path):
|
|
21
21
|
ndk_found = False
|
|
22
22
|
try:
|
package/releng/env_apple.py
CHANGED
|
@@ -2,7 +2,7 @@ from configparser import ConfigParser
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
import shlex
|
|
4
4
|
import subprocess
|
|
5
|
-
from typing import Callable, Optional
|
|
5
|
+
from typing import Callable, Dict, List, Optional
|
|
6
6
|
|
|
7
7
|
from .machine_file import strv_to_meson
|
|
8
8
|
from .machine_spec import MachineSpec
|
|
@@ -11,13 +11,13 @@ from .machine_spec import MachineSpec
|
|
|
11
11
|
def init_machine_config(machine: MachineSpec,
|
|
12
12
|
build_machine: MachineSpec,
|
|
13
13
|
is_cross_build: bool,
|
|
14
|
-
environ:
|
|
14
|
+
environ: Dict[str, str],
|
|
15
15
|
toolchain_prefix: Optional[Path],
|
|
16
16
|
sdk_prefix: Optional[Path],
|
|
17
17
|
call_selected_meson: Callable,
|
|
18
18
|
config: ConfigParser,
|
|
19
|
-
outpath:
|
|
20
|
-
outenv:
|
|
19
|
+
outpath: List[str],
|
|
20
|
+
outenv: Dict[str, str],
|
|
21
21
|
outdir: Path):
|
|
22
22
|
xcenv = {**environ}
|
|
23
23
|
if machine.arch == "arm64eoabi":
|
package/releng/env_generic.py
CHANGED
|
@@ -5,7 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
import shutil
|
|
6
6
|
import subprocess
|
|
7
7
|
import tempfile
|
|
8
|
-
from typing import Callable, Optional, Mapping, Sequence
|
|
8
|
+
from typing import Callable, Dict, List, Optional, Mapping, Sequence, Tuple
|
|
9
9
|
|
|
10
10
|
from . import winenv
|
|
11
11
|
from .machine_file import strv_to_meson
|
|
@@ -15,13 +15,13 @@ from .machine_spec import MachineSpec
|
|
|
15
15
|
def init_machine_config(machine: MachineSpec,
|
|
16
16
|
build_machine: MachineSpec,
|
|
17
17
|
is_cross_build: bool,
|
|
18
|
-
environ:
|
|
18
|
+
environ: Dict[str, str],
|
|
19
19
|
toolchain_prefix: Optional[Path],
|
|
20
20
|
sdk_prefix: Optional[Path],
|
|
21
21
|
call_selected_meson: Callable,
|
|
22
22
|
config: ConfigParser,
|
|
23
|
-
outpath:
|
|
24
|
-
outenv:
|
|
23
|
+
outpath: List[str],
|
|
24
|
+
outenv: Dict[str, str],
|
|
25
25
|
outdir: Path):
|
|
26
26
|
allow_undefined_symbols = machine.os == "freebsd"
|
|
27
27
|
|
|
@@ -201,10 +201,9 @@ def init_machine_config(machine: MachineSpec,
|
|
|
201
201
|
if linker_flavor.startswith("gnu-"):
|
|
202
202
|
linker_flags += ["-static-libgcc"]
|
|
203
203
|
if machine.os != "windows":
|
|
204
|
-
linker_flags += [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
]
|
|
204
|
+
linker_flags += ["-Wl,-z,noexecstack"]
|
|
205
|
+
if machine.os != "none":
|
|
206
|
+
linker_flags += ["-Wl,-z,relro"]
|
|
208
207
|
cxx_link_flags += ["-static-libstdc++"]
|
|
209
208
|
|
|
210
209
|
if linker_flavor == "apple":
|
|
@@ -214,6 +213,9 @@ def init_machine_config(machine: MachineSpec,
|
|
|
214
213
|
if linker_flavor == "gnu-gold":
|
|
215
214
|
linker_flags += ["-Wl,--icf=all"]
|
|
216
215
|
|
|
216
|
+
if machine.os == "none":
|
|
217
|
+
linker_flags += ["-specs=nosys.specs"]
|
|
218
|
+
|
|
217
219
|
constants = config["constants"]
|
|
218
220
|
constants["common_flags"] = strv_to_meson(common_flags)
|
|
219
221
|
constants["c_like_flags"] = strv_to_meson(c_like_flags)
|
|
@@ -222,7 +224,7 @@ def init_machine_config(machine: MachineSpec,
|
|
|
222
224
|
constants["cxx_link_flags"] = strv_to_meson(cxx_link_flags)
|
|
223
225
|
|
|
224
226
|
|
|
225
|
-
def resolve_gcc_binaries(toolprefix: str = "") ->
|
|
227
|
+
def resolve_gcc_binaries(toolprefix: str = "") -> Tuple[List[str], Dict[str, str]]:
|
|
226
228
|
cc = None
|
|
227
229
|
binaries = OrderedDict()
|
|
228
230
|
|
|
@@ -255,7 +257,7 @@ def resolve_gcc_binaries(toolprefix: str = "") -> tuple[list[str], dict[str, str
|
|
|
255
257
|
return (cc, binaries)
|
|
256
258
|
|
|
257
259
|
|
|
258
|
-
def detect_linker_flavor(cc:
|
|
260
|
+
def detect_linker_flavor(cc: List[str]) -> str:
|
|
259
261
|
linker_version = subprocess.run(cc + ["-Wl,--version"],
|
|
260
262
|
stdout=subprocess.PIPE,
|
|
261
263
|
stderr=subprocess.STDOUT,
|
|
@@ -266,7 +268,7 @@ def detect_linker_flavor(cc: list[str]) -> str:
|
|
|
266
268
|
return "gnu-ld"
|
|
267
269
|
if "GNU gold " in linker_version:
|
|
268
270
|
return "gnu-gold"
|
|
269
|
-
if linker_version.startswith("LLD "):
|
|
271
|
+
if linker_version.startswith("LLD ") or "compatible with GNU linkers" in linker_version:
|
|
270
272
|
return "lld"
|
|
271
273
|
if linker_version.startswith("ld: "):
|
|
272
274
|
return "apple"
|
|
@@ -305,6 +307,10 @@ ARCH_COMMON_FLAGS_UNIX = {
|
|
|
305
307
|
"-mfpu=neon-vfpv4",
|
|
306
308
|
"-mthumb",
|
|
307
309
|
],
|
|
310
|
+
"armv6kz": [
|
|
311
|
+
"-march=armv6kz",
|
|
312
|
+
"-mcpu=arm1176jzf-s",
|
|
313
|
+
],
|
|
308
314
|
"arm64": [
|
|
309
315
|
"-march=armv8-a",
|
|
310
316
|
],
|
package/releng/frida_version.py
CHANGED
|
@@ -6,6 +6,7 @@ import os
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
import subprocess
|
|
8
8
|
import sys
|
|
9
|
+
from typing import List
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
RELENG_DIR = Path(__file__).resolve().parent
|
|
@@ -22,7 +23,7 @@ class FridaVersion:
|
|
|
22
23
|
commit: str
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
def main(argv:
|
|
26
|
+
def main(argv: List[str]):
|
|
26
27
|
parser = argparse.ArgumentParser()
|
|
27
28
|
parser.add_argument("repo", nargs="?", type=Path, default=ROOT_DIR)
|
|
28
29
|
args = parser.parse_args()
|
package/releng/machine_file.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from configparser import ConfigParser
|
|
2
2
|
from pathlib import Path
|
|
3
|
-
from typing import Sequence, Union
|
|
3
|
+
from typing import Dict, List, Sequence, Union
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def load(mfile: Path) ->
|
|
6
|
+
def load(mfile: Path) -> Dict[str, Union[str, List[str]]]:
|
|
7
7
|
config = ConfigParser()
|
|
8
8
|
config.read(mfile)
|
|
9
9
|
|
package/releng/machine_spec.py
CHANGED
|
@@ -3,7 +3,7 @@ from dataclasses import dataclass
|
|
|
3
3
|
import platform
|
|
4
4
|
import re
|
|
5
5
|
import subprocess
|
|
6
|
-
from typing import Optional
|
|
6
|
+
from typing import List, Optional
|
|
7
7
|
|
|
8
8
|
if platform.system() == "Windows":
|
|
9
9
|
import ctypes
|
|
@@ -145,7 +145,7 @@ class MachineSpec:
|
|
|
145
145
|
return True
|
|
146
146
|
|
|
147
147
|
@property
|
|
148
|
-
def meson_optimization_options(self) ->
|
|
148
|
+
def meson_optimization_options(self) -> List[str]:
|
|
149
149
|
if self.config_is_optimized:
|
|
150
150
|
optimization = "s"
|
|
151
151
|
ndebug = "true"
|
|
@@ -335,6 +335,7 @@ CPU_FAMILIES = {
|
|
|
335
335
|
"armbe8": "arm",
|
|
336
336
|
"armeabi": "arm",
|
|
337
337
|
"armhf": "arm",
|
|
338
|
+
"armv6kz": "arm",
|
|
338
339
|
|
|
339
340
|
"arm64": "aarch64",
|
|
340
341
|
"arm64be": "aarch64",
|
|
@@ -353,6 +354,7 @@ CPU_TYPES = {
|
|
|
353
354
|
"armbe8": "armv6",
|
|
354
355
|
"armhf": "armv7hf",
|
|
355
356
|
"armeabi": "armv7eabi",
|
|
357
|
+
"armv6kz": "armv6",
|
|
356
358
|
|
|
357
359
|
"arm64": "aarch64",
|
|
358
360
|
"arm64be": "aarch64",
|
|
@@ -366,6 +368,7 @@ CPU_TYPES_PER_OS_OVERRIDES = {
|
|
|
366
368
|
"arm": "armv5t",
|
|
367
369
|
"armbe8": "armv6t",
|
|
368
370
|
"armhf": "armv7a",
|
|
371
|
+
"armv6kz": "armv6t",
|
|
369
372
|
|
|
370
373
|
"mips": "mips1",
|
|
371
374
|
"mipsel": "mips1",
|
|
@@ -1238,7 +1238,7 @@ class CLikeCompiler(Compiler):
|
|
|
1238
1238
|
def thread_flags(self, env: 'Environment') -> T.List[str]:
|
|
1239
1239
|
# TODO: does this belong here or in GnuLike or maybe PosixLike?
|
|
1240
1240
|
host_m = env.machines[self.for_machine]
|
|
1241
|
-
if host_m.is_haiku() or host_m.is_darwin():
|
|
1241
|
+
if host_m.is_haiku() or host_m.is_darwin() or host_m.is_none():
|
|
1242
1242
|
return []
|
|
1243
1243
|
return ['-pthread']
|
|
1244
1244
|
|
|
@@ -366,6 +366,12 @@ class MachineInfo(HoldableObject):
|
|
|
366
366
|
"""Machine is IRIX?"""
|
|
367
367
|
return self.system.startswith('irix')
|
|
368
368
|
|
|
369
|
+
def is_none(self) -> bool:
|
|
370
|
+
"""
|
|
371
|
+
Machine has no standard OS, e.g. kernel or firmware?
|
|
372
|
+
"""
|
|
373
|
+
return self.system == 'none'
|
|
374
|
+
|
|
369
375
|
# Various prefixes and suffixes for import libraries, shared libraries,
|
|
370
376
|
# static libraries, and executables.
|
|
371
377
|
# Versioning is added to these names in the backends as-needed.
|
|
@@ -641,7 +641,8 @@ class GnuLikeDynamicLinkerMixin(DynamicLinkerBase):
|
|
|
641
641
|
return self._apply_prefix('--out-implib=' + implibname)
|
|
642
642
|
|
|
643
643
|
def thread_flags(self, env: 'Environment') -> T.List[str]:
|
|
644
|
-
|
|
644
|
+
host_m = env.machines[self.for_machine]
|
|
645
|
+
if host_m.is_haiku() or host_m.is_none():
|
|
645
646
|
return []
|
|
646
647
|
return ['-pthread']
|
|
647
648
|
|
|
@@ -8,7 +8,7 @@ import shlex
|
|
|
8
8
|
import shutil
|
|
9
9
|
import subprocess
|
|
10
10
|
import sys
|
|
11
|
-
from typing import Any, Callable, Optional
|
|
11
|
+
from typing import Any, Callable, Dict, List, Optional, Set
|
|
12
12
|
|
|
13
13
|
RELENG_DIR = Path(__file__).resolve().parent
|
|
14
14
|
SCRIPTS_DIR = RELENG_DIR / "meson-scripts"
|
|
@@ -35,7 +35,8 @@ def main():
|
|
|
35
35
|
builddir = Path(os.environ.get("MESON_BUILD_ROOT", default_builddir)).resolve()
|
|
36
36
|
|
|
37
37
|
parser = argparse.ArgumentParser(prog="configure",
|
|
38
|
-
add_help=False
|
|
38
|
+
add_help=False,
|
|
39
|
+
formatter_class=argparse.RawTextHelpFormatter)
|
|
39
40
|
opts = parser.add_argument_group(title="generic options")
|
|
40
41
|
opts.add_argument("-h", "--help",
|
|
41
42
|
help="show this help message and exit",
|
|
@@ -118,12 +119,12 @@ def configure(sourcedir: Path,
|
|
|
118
119
|
prefix: Optional[str] = None,
|
|
119
120
|
build_machine: Optional[MachineSpec] = None,
|
|
120
121
|
host_machine: Optional[MachineSpec] = None,
|
|
121
|
-
environ:
|
|
122
|
+
environ: Dict[str, str] = os.environ,
|
|
122
123
|
debug_symbols: str = "stripped",
|
|
123
124
|
default_library: str = "static",
|
|
124
|
-
allowed_prebuilds:
|
|
125
|
+
allowed_prebuilds: Set[str] = None,
|
|
125
126
|
meson: str = "internal",
|
|
126
|
-
extra_meson_options:
|
|
127
|
+
extra_meson_options: List[str] = [],
|
|
127
128
|
call_meson: Callable = env.call_meson,
|
|
128
129
|
on_progress: ProgressCallback = print_progress):
|
|
129
130
|
if prefix is None:
|
|
@@ -243,7 +244,7 @@ def parse_prefix(raw_prefix: str) -> Path:
|
|
|
243
244
|
return prefix
|
|
244
245
|
|
|
245
246
|
|
|
246
|
-
def query_supported_bundle_types(include_wildcards: bool) ->
|
|
247
|
+
def query_supported_bundle_types(include_wildcards: bool) -> List[str]:
|
|
247
248
|
for e in deps.Bundle:
|
|
248
249
|
identifier = e.name.lower()
|
|
249
250
|
if e == deps.Bundle.SDK:
|
|
@@ -255,11 +256,11 @@ def query_supported_bundle_types(include_wildcards: bool) -> list[str]:
|
|
|
255
256
|
yield identifier
|
|
256
257
|
|
|
257
258
|
|
|
258
|
-
def query_supported_bundle_type_values() ->
|
|
259
|
+
def query_supported_bundle_type_values() -> List[deps.Bundle]:
|
|
259
260
|
return [e for e in deps.Bundle]
|
|
260
261
|
|
|
261
262
|
|
|
262
|
-
def parse_bundle_type_set(raw_array: str) ->
|
|
263
|
+
def parse_bundle_type_set(raw_array: str) -> List[str]:
|
|
263
264
|
supported_types = list(query_supported_bundle_types(include_wildcards=True))
|
|
264
265
|
result = set()
|
|
265
266
|
for element in raw_array.split(","):
|
|
@@ -411,7 +412,7 @@ def help_text_from_meson(description: str) -> str:
|
|
|
411
412
|
return description
|
|
412
413
|
|
|
413
414
|
|
|
414
|
-
def collect_meson_options(options: argparse.Namespace) ->
|
|
415
|
+
def collect_meson_options(options: argparse.Namespace) -> List[str]:
|
|
415
416
|
result = []
|
|
416
417
|
|
|
417
418
|
for raw_name, raw_val in vars(options).items():
|
|
@@ -429,11 +430,11 @@ def collect_meson_options(options: argparse.Namespace) -> list[str]:
|
|
|
429
430
|
return result
|
|
430
431
|
|
|
431
432
|
|
|
432
|
-
def make_array_option_value_parser(opt: UserOption[Any]) -> Callable[[str],
|
|
433
|
+
def make_array_option_value_parser(opt: UserOption[Any]) -> Callable[[str], List[str]]:
|
|
433
434
|
return lambda v: parse_array_option_value(v, opt)
|
|
434
435
|
|
|
435
436
|
|
|
436
|
-
def parse_array_option_value(v: str, opt: UserArrayOption) ->
|
|
437
|
+
def parse_array_option_value(v: str, opt: UserArrayOption) -> List[str]:
|
|
437
438
|
vals = [v.strip() for v in v.split(",")]
|
|
438
439
|
|
|
439
440
|
choices = opt.choices
|
package/releng/meson_make.py
CHANGED
|
@@ -5,7 +5,7 @@ import pickle
|
|
|
5
5
|
import shlex
|
|
6
6
|
import shutil
|
|
7
7
|
import sys
|
|
8
|
-
from typing import Callable
|
|
8
|
+
from typing import Callable, Dict, List
|
|
9
9
|
|
|
10
10
|
from . import env
|
|
11
11
|
from .meson_configure import configure
|
|
@@ -41,8 +41,8 @@ def main():
|
|
|
41
41
|
|
|
42
42
|
def make(sourcedir: Path,
|
|
43
43
|
builddir: Path,
|
|
44
|
-
targets:
|
|
45
|
-
environ:
|
|
44
|
+
targets: List[str],
|
|
45
|
+
environ: Dict[str, str] = os.environ,
|
|
46
46
|
call_meson: Callable = env.call_meson):
|
|
47
47
|
if not (builddir / "build.ninja").exists():
|
|
48
48
|
configure(sourcedir, builddir, environ=environ)
|
package/releng/mkdevkit.py
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
|
+
from enum import Enum
|
|
4
5
|
import hashlib
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
import subprocess
|
|
7
8
|
import sys
|
|
8
|
-
|
|
9
|
+
import textwrap
|
|
10
|
+
from typing import Dict, List, Optional
|
|
9
11
|
|
|
10
12
|
REPO_ROOT = Path(__file__).resolve().parent.parent
|
|
11
13
|
sys.path.insert(0, str(REPO_ROOT))
|
|
12
14
|
from releng import devkit, env, machine_spec
|
|
13
15
|
|
|
16
|
+
DepSymbolScope = devkit.DepSymbolScope
|
|
17
|
+
|
|
14
18
|
|
|
15
19
|
def main():
|
|
16
|
-
raw_args:
|
|
17
|
-
ool_optvals:
|
|
20
|
+
raw_args: List[str] = []
|
|
21
|
+
ool_optvals: Dict[str, List[str]] = {}
|
|
18
22
|
pending_raw_args = sys.argv[1:]
|
|
19
23
|
while len(pending_raw_args) > 0:
|
|
20
24
|
cur = pending_raw_args.pop(0)
|
|
@@ -33,7 +37,7 @@ def main():
|
|
|
33
37
|
else:
|
|
34
38
|
raw_args.append(cur)
|
|
35
39
|
|
|
36
|
-
parser = argparse.ArgumentParser()
|
|
40
|
+
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
|
|
37
41
|
parser.add_argument("kit")
|
|
38
42
|
parser.add_argument("machine",
|
|
39
43
|
type=machine_spec.MachineSpec.parse)
|
|
@@ -45,6 +49,16 @@ def main():
|
|
|
45
49
|
dest="flavor",
|
|
46
50
|
const="_thin",
|
|
47
51
|
default="")
|
|
52
|
+
parser.add_argument("--dep-symbol-scope",
|
|
53
|
+
metavar="S",
|
|
54
|
+
type=DepSymbolScope,
|
|
55
|
+
choices=list(DepSymbolScope),
|
|
56
|
+
default=DepSymbolScope.PREFIXED.value,
|
|
57
|
+
help=textwrap.dedent("""\
|
|
58
|
+
how to scope symbols from third-party archives:
|
|
59
|
+
- prefixed: add the '_frida_' prefix
|
|
60
|
+
- original: keep symbols exactly as upstream
|
|
61
|
+
"""))
|
|
48
62
|
parser.add_argument("--cc",
|
|
49
63
|
help="C compiler to use",
|
|
50
64
|
type=lambda v: parse_array_option_value(v, ool_optvals))
|
|
@@ -52,7 +66,7 @@ def main():
|
|
|
52
66
|
for name in machine_options.keys():
|
|
53
67
|
pretty_name = name.replace("_", "-")
|
|
54
68
|
parser.add_argument("--" + pretty_name,
|
|
55
|
-
help=f"
|
|
69
|
+
help=f"the {pretty_name} to use",
|
|
56
70
|
type=lambda v: parse_array_option_value(v, ool_optvals))
|
|
57
71
|
|
|
58
72
|
options = parser.parse_args(raw_args)
|
|
@@ -82,7 +96,7 @@ def main():
|
|
|
82
96
|
assert meson_config is not None
|
|
83
97
|
|
|
84
98
|
try:
|
|
85
|
-
app = devkit.CompilerApplication(kit, machine, meson_config, outdir)
|
|
99
|
+
app = devkit.CompilerApplication(kit, machine, meson_config, outdir, options.dep_symbol_scope)
|
|
86
100
|
app.run()
|
|
87
101
|
except subprocess.CalledProcessError as e:
|
|
88
102
|
print(e, file=sys.stderr)
|
|
@@ -93,7 +107,7 @@ def main():
|
|
|
93
107
|
sys.exit(1)
|
|
94
108
|
|
|
95
109
|
|
|
96
|
-
def parse_array_option_value(val: str, ool_optvals:
|
|
110
|
+
def parse_array_option_value(val: str, ool_optvals: Dict[str, List[str]]) -> Optional[List[str]]:
|
|
97
111
|
if val == "":
|
|
98
112
|
return None
|
|
99
113
|
if val.startswith("ool:"):
|
package/releng/winenv.py
CHANGED
|
@@ -4,7 +4,7 @@ import os
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
import platform
|
|
6
6
|
import subprocess
|
|
7
|
-
from typing import Optional
|
|
7
|
+
from typing import List, Optional, Tuple
|
|
8
8
|
if platform.system() == "Windows":
|
|
9
9
|
import winreg
|
|
10
10
|
|
|
@@ -53,7 +53,7 @@ def detect_msvc_tool_dir(toolchain_prefix: Optional[Path]) -> Path:
|
|
|
53
53
|
return cached_msvc_dir
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
def detect_windows_sdk() ->
|
|
56
|
+
def detect_windows_sdk() -> Tuple[Path, str]:
|
|
57
57
|
global cached_winsdk
|
|
58
58
|
if cached_winsdk is None:
|
|
59
59
|
try:
|
|
@@ -82,7 +82,7 @@ def detect_msvs_tool_path(machine: MachineSpec,
|
|
|
82
82
|
|
|
83
83
|
def detect_msvs_runtime_path(machine: MachineSpec,
|
|
84
84
|
build_machine: MachineSpec,
|
|
85
|
-
toolchain_prefix: Optional[Path]) ->
|
|
85
|
+
toolchain_prefix: Optional[Path]) -> List[Path]:
|
|
86
86
|
msvc_platform = machine.msvc_platform
|
|
87
87
|
native_msvc_platform = build_machine.msvc_platform
|
|
88
88
|
|
|
@@ -99,7 +99,7 @@ def detect_msvs_runtime_path(machine: MachineSpec,
|
|
|
99
99
|
return [winsdk_bindir, msvc_bindir] + msvc_dll_dirs
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
def detect_msvs_include_path(toolchain_prefix: Optional[Path]) ->
|
|
102
|
+
def detect_msvs_include_path(toolchain_prefix: Optional[Path]) -> List[Path]:
|
|
103
103
|
msvc_dir = detect_msvc_tool_dir(toolchain_prefix)
|
|
104
104
|
vc_dir = detect_msvs_installation_dir(toolchain_prefix) / "VC"
|
|
105
105
|
|
|
@@ -118,7 +118,7 @@ def detect_msvs_include_path(toolchain_prefix: Optional[Path]) -> list[Path]:
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
def detect_msvs_library_path(machine: MachineSpec,
|
|
121
|
-
toolchain_prefix: Optional[Path]) ->
|
|
121
|
+
toolchain_prefix: Optional[Path]) -> List[Path]:
|
|
122
122
|
msvc_platform = machine.msvc_platform
|
|
123
123
|
|
|
124
124
|
msvc_dir = detect_msvc_tool_dir(toolchain_prefix)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|