citadel/meta-gnome/recipes-support/mozjs/mozjs-91/0001-rewrite-cargo-host-linker-in-python3.patch
Bruce Leidl be34ea65f3 upgrade poky layer to 'kirkstone' release 4.0.1
- removed layers meta-rust and meta-clang
- added new dependencies to Makefile
- changed override syntax across all recipe files
- updated conf files from hardknott to kirkstone
- SRC_URI git URLS fixed to always include branch and protocol
- LICENSE fields updated with new naming convention
- updated citadel-tools dependencies

- upgraded mozjs to mozjs-91

No longer needed because poky includes newer version (or new enough):

- glib-2.0
- libgudev
- xorgproto
- libxfixes
- libinput
- wayland-protocols
- vte
2022-05-28 11:20:07 -04:00

57 lines
2.1 KiB
Diff

From 9eceb43dd676afe2f675bd65ab369ba4d14f6537 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Thu, 18 Nov 2021 07:16:39 +0000
Subject: [PATCH] Rewrite cargo-host-linker in python3
Mozjs compile failed with this failure:
/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)
Root Cause:
cargo-host-linker has /bin/sh as it's interpreter, but cargo run the cmd
with LD_LIBRARY_PATH set to recipe-sysroot-native. The host /bin/sh links
libtinfo.so.5 under recipe-sysroot-native, which needs higher libc. But
host libc is older libc. So the incompatible problem occurred.
Solution:
rewrite cargo-host-linker in python3
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
build/cargo-host-linker | 24 +++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/build/cargo-host-linker b/build/cargo-host-linker
index cbd0472bf7..ccd8bffec1 100755
--- a/build/cargo-host-linker
+++ b/build/cargo-host-linker
@@ -1,3 +1,21 @@
-#!/bin/sh
-# See comment in cargo-linker.
-eval ${MOZ_CARGO_WRAP_HOST_LD} ${MOZ_CARGO_WRAP_HOST_LDFLAGS} '"$@"'
+#!/usr/bin/env python3
+
+import os,sys
+
+if os.environ['MOZ_CARGO_WRAP_HOST_LD'].strip():
+ binary=os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]
+else:
+ sys.exit(0)
+
+if os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS'].strip():
+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
+ 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:]
+ else:
+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + [os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS']] + sys.argv[1:]
+else:
+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:] + sys.argv[1:]
+ else:
+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + sys.argv[1:]
+
+os.execvp(binary, args)
--
2.33.1