From 9367cc56e0b1ce8a36ca01e324ee377af3ebc9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 1 May 2024 14:15:09 +0200 Subject: [PATCH] compat: Omit when building for Apple's simulators There's no point in supporting arm64e there. --- compat/build.py | 8 ++++++-- compat/meson.build | 1 + meson.build | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/compat/build.py b/compat/build.py index 1de829406..c002e6beb 100644 --- a/compat/build.py +++ b/compat/build.py @@ -32,6 +32,7 @@ def main(argv): command.add_argument("frida_version", help="the Frida version") command.add_argument("host_os", help="operating system binaries are being built for") command.add_argument("host_arch", help="architecture binaries are being built for") + command.add_argument("host_config", help="configuration binaries are being built for") command.add_argument("host_toolchain", help="the kind of toolchain being used", choices=["microsoft", "apple", "gnu"]) command.add_argument("compat", help="support for targets with a different architecture", @@ -45,6 +46,7 @@ def main(argv): args.frida_version, args.host_os, args.host_arch, + args.host_config, args.host_toolchain, args.compat, args.assets, @@ -89,6 +91,7 @@ def setup(role: Role, frida_version: str, host_os: str, host_arch: str, + host_config: str, host_toolchain: str, compat: set[str], assets: str, @@ -132,7 +135,7 @@ def setup(role: Role, target=GADGET_TARGET), ] - if host_os in {"macos", "ios"} and host_arch in {"arm64e", "arm64"}: + if host_os in {"macos", "ios"} and host_arch in {"arm64e", "arm64"} and host_config != "simulator": if host_arch == "arm64e": other_arch = "arm64" kind = "legacy" @@ -225,7 +228,7 @@ def setup(role: Role, target=AGENT_TARGET), ] - state = State(role, builddir, top_builddir, frida_version, host_os, host_arch, host_toolchain, outputs) + state = State(role, builddir, top_builddir, frida_version, host_os, host_arch, host_config, host_toolchain, outputs) serialized_state = base64.b64encode(pickle.dumps(state)).decode('ascii') variable_names, output_names = zip(*[(output.identifier, output.name) \ @@ -241,6 +244,7 @@ class State: frida_version: str host_os: str host_arch: str + host_config: str host_toolchain: str outputs: Mapping[str, Sequence[Output]] diff --git a/compat/meson.build b/compat/meson.build index 1c458e2af..470da5a71 100644 --- a/compat/meson.build +++ b/compat/meson.build @@ -40,6 +40,7 @@ if no_overridden_compat_bits frida_version, host_os, host_abi, + host_config, host_toolchain, ','.join(get_option('compat')), get_option('assets'), diff --git a/meson.build b/meson.build index 33ef0e3a4..debd0acb0 100644 --- a/meson.build +++ b/meson.build @@ -51,7 +51,9 @@ host_os_family = host_machine.system() if host_os_family == 'android' host_os_family = 'linux' endif -host_os = host_machine.subsystem().split('-')[0] +tokens = host_machine.subsystem().split('-') +host_os = tokens[0] +host_config = (tokens.length() == 2) ? tokens[1] : '' if host_machine.cpu_family() == 'arm' host_arch = 'arm' host_abi = 'arm'