aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/mozjs/mozjs-91/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch
blob: c440bf178f0737dc94aa03324f8d2a5cdb87df8c (plain)
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
From 749ba11fd6a69c8180945d4866415d16ae06a9c0 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Fri, 1 Oct 2021 13:02:17 +0200
Subject: [PATCH] rust.configure: do not try to find a suitable upstream target

OE is using custom targets and so this is bound to fail.

Upstream-Status: Inapppropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 build/moz.configure/rust.configure | 34 ++----------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
index cd77d72bb7..4b6481cbe3 100644
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -459,33 +459,7 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
 def rust_host_triple(
     rustc, host, compiler_info, rustc_host, rust_supported_targets, arm_target
 ):
-    rustc_target = detect_rustc_target(
-        host, compiler_info, arm_target, rust_supported_targets
-    )
-    if rustc_target != rustc_host:
-        if host.alias == rustc_target:
-            configure_host = host.alias
-        else:
-            configure_host = "{}/{}".format(host.alias, rustc_target)
-        die(
-            dedent(
-                """\
-        The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
-
-        You can solve this by:
-        * Set your configure host to match the rust compiler host by editing your
-        mozconfig and adding "ac_add_options --host={rustc}".
-        * Or, install the rust toolchain for {configure}, if supported, by running
-        "rustup default stable-{rustc_target}"
-        """.format(
-                    rustc=rustc_host,
-                    configure=configure_host,
-                    rustc_target=rustc_target,
-                )
-            )
-        )
-    assert_rust_compile(host, rustc_target, rustc)
-    return rustc_target
+    return rustc_host
 
 
 @depends(
@@ -495,11 +469,7 @@ def rust_host_triple(
 def rust_target_triple(
     rustc, target, compiler_info, rust_supported_targets, arm_target
 ):
-    rustc_target = detect_rustc_target(
-        target, compiler_info, arm_target, rust_supported_targets
-    )
-    assert_rust_compile(target, rustc_target, rustc)
-    return rustc_target
+    return target.alias
 
 
 set_config("RUST_TARGET", rust_target_triple)