Bug 1851739 - Switch default target for android to x86_64 on x86_64 hosts. r=geckoview-reviewers,owlish

Differential Revision: https://phabricator.services.mozilla.com/D205760
This commit is contained in:
Mike Hommey 2024-04-01 21:20:14 +00:00
parent 6ad453491b
commit 733fb2d4df
2 changed files with 17 additions and 6 deletions

View File

@ -739,11 +739,10 @@ def real_target(value, host, shell, project, application):
project = project[0]
if not value:
if project == "mobile/android":
target_cpu, target_system = (
("aarch64", "android")
if host.cpu == "aarch64"
else ("arm", "androideabi")
)
target_cpu, target_system = {
"aarch64": ("aarch64", "android"),
"x86_64": ("x86_64", "android"),
}.get(host.cpu, ("arm", "androideabi"))
return split_triplet(f"{target_cpu}-unknown-linux-{target_system}")
if project == "mobile/ios":
return split_triplet("aarch64-apple-ios")

View File

@ -28,6 +28,8 @@ class TargetTest(BaseConfigureTest):
platform = "win32"
elif "openbsd6" in self.HOST:
platform = "openbsd6"
elif "apple-darwin" in self.HOST:
platform = "darwin"
else:
raise Exception("Missing platform for HOST {}".format(self.HOST))
sandbox = self.get_sandbox({}, {}, args, env, cls=sandbox_class(platform))
@ -111,7 +113,7 @@ class TestTargetAndroid(TargetTest):
def test_target(self):
self.assertEqual(
self.get_target(["--enable-project=mobile/android"]),
"arm-unknown-linux-androideabi",
"x86_64-unknown-linux-android",
)
self.assertEqual(
self.get_target(["--enable-project=mobile/android", "--target=i686"]),
@ -131,6 +133,16 @@ class TestTargetAndroid(TargetTest):
)
class TestTargetAndroidAppleSiliconHost(TargetTest):
HOST = "aarch64-apple-darwin"
def test_target(self):
self.assertEqual(
self.get_target(["--enable-project=mobile/android"]),
"aarch64-unknown-linux-android",
)
class TestTargetOpenBSD(TargetTest):
# config.guess returns amd64 on OpenBSD, which we need to pass through to
# config.sub so that it canonicalizes to x86_64.