summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch')
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch
new file mode 100644
index 0000000000..94e1651b33
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch
@@ -0,0 +1,53 @@
1From 6f6b78628a8edc834aa147c87ebce3eb8e670e7a Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 18 Nov 2021 07:16:39 +0000
4Subject: [PATCH] Rewrite cargo-host-linker in python3
5
6Mozjs compile failed with this failure:
7/bin/sh: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /build/tmp-glibc/work/corei7-64-wrs-linux/mozjs/91.1.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so.5)
8
9Root Cause:
10cargo-host-linker has /bin/sh as it's interpreter, but cargo run the cmd
11with LD_LIBRARY_PATH set to recipe-sysroot-native. The host /bin/sh links
12libtinfo.so.5 under recipe-sysroot-native, which needs higher libc. But
13host libc is older libc. So the incompatible problem occurred.
14
15Solution:
16rewrite cargo-host-linker in python3
17
18Upstream-Status: Inappropriate [oe specific]
19
20Signed-off-by: Changqing Li <changqing.li@windriver.com>
21---
22 build/cargo-host-linker | 24 +++++++++++++++++++++---
23 1 file changed, 21 insertions(+), 3 deletions(-)
24
25diff --git a/build/cargo-host-linker b/build/cargo-host-linker
26index cbd0472bf7..87d43ce9ec 100755
27--- a/build/cargo-host-linker
28+++ b/build/cargo-host-linker
29@@ -1,3 +1,21 @@
30-#!/bin/sh
31-# See comment in cargo-linker.
32-eval ${MOZ_CARGO_WRAP_HOST_LD} ${MOZ_CARGO_WRAP_HOST_LDFLAGS} '"$@"'
33+#!/usr/bin/env python3
34+
35+import os,sys
36+
37+if os.environ['MOZ_CARGO_WRAP_HOST_LD'].strip():
38+ binary=os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]
39+else:
40+ sys.exit(0)
41+
42+if os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS'].strip():
43+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
44+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:] + [os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS']] + sys.argv[1:]
45+ else:
46+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + [os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS']] + sys.argv[1:]
47+else:
48+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
49+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:] + sys.argv[1:]
50+ else:
51+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + sys.argv[1:]
52+
53+os.execvp(binary, args)