diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-01-27 11:20:05 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-01 07:31:18 +0000 |
commit | 1adbf5ba2727f0023f31720e0ac7bcb2e67f039b (patch) | |
tree | 2ddb88a41d8dd4123a68466456d7983054db6632 | |
parent | 8b562100df06f4655eb377ec259b58b10a13abee (diff) | |
download | poky-1adbf5ba2727f0023f31720e0ac7bcb2e67f039b.tar.gz |
gobject-introspection: replace prelink-rtld with objdump -p
g-i internally processes the output with regexes, and seems
happy with what objdump is printing. It only needs to resolve
the library name as passed to the linker to the library file name.
Also recursive resolution (that ldd is doing and objdump is not)
is not necessary.
(From OE-Core rev: 767e0880d4d729e659e859dd99c1cdb084b8ba51)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 3 insertions, 41 deletions
diff --git a/meta/classes/gobject-introspection.bbclass b/meta/classes/gobject-introspection.bbclass index 4db1b362d9..7bf9feb0d6 100644 --- a/meta/classes/gobject-introspection.bbclass +++ b/meta/classes/gobject-introspection.bbclass | |||
@@ -29,7 +29,7 @@ EXTRA_OEMESON:prepend:class-nativesdk = "${@['', '${GIRMESONBUILD}'][d.getVar('G | |||
29 | 29 | ||
30 | # Generating introspection data depends on a combination of native and target | 30 | # Generating introspection data depends on a combination of native and target |
31 | # introspection tools, and qemu to run the target tools. | 31 | # introspection tools, and qemu to run the target tools. |
32 | DEPENDS:append:class-target = " gobject-introspection gobject-introspection-native qemu-native prelink-native" | 32 | DEPENDS:append:class-target = " gobject-introspection gobject-introspection-native qemu-native" |
33 | 33 | ||
34 | # Even though introspection is disabled on -native, gobject-introspection package is still | 34 | # Even though introspection is disabled on -native, gobject-introspection package is still |
35 | # needed for m4 macros. | 35 | # needed for m4 macros. |
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch deleted file mode 100644 index b484b5e9e6..0000000000 --- a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | From f742da8b3913f4818d3f419117076afe62f4dbf4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Wed, 5 Sep 2018 16:46:52 +0200 | ||
4 | Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper | ||
5 | |||
6 | prelink-rtld, which we use instead of ldd returns 127 when it can't find a library. | ||
7 | It is not an error per se, but it breaks subprocess.check_output(). | ||
8 | |||
9 | Upstream-Status: Inappropriate [oe-core specific] | ||
10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
11 | |||
12 | --- | ||
13 | giscanner/shlibs.py | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py | ||
17 | index d67df95..80352a6 100644 | ||
18 | --- a/giscanner/shlibs.py | ||
19 | +++ b/giscanner/shlibs.py | ||
20 | @@ -102,7 +102,7 @@ def _resolve_non_libtool(options, binary, libraries): | ||
21 | args.extend(['otool', '-L', binary.args[0]]) | ||
22 | else: | ||
23 | args.extend(['ldd', binary.args[0]]) | ||
24 | - output = subprocess.check_output(args) | ||
25 | + output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout | ||
26 | if isinstance(output, bytes): | ||
27 | output = output.decode("utf-8", "replace") | ||
28 | |||
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.70.0.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.70.0.bb index d4ee03d33c..4f72a33bfa 100644 --- a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.70.0.bb +++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.70.0.bb | |||
@@ -14,7 +14,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c434e8128a68bedd59b80b2ac1eb1c4a \ | |||
14 | " | 14 | " |
15 | 15 | ||
16 | SRC_URI = "${GNOME_MIRROR}/${BPN}/${@oe.utils.trim_version("${PV}", 2)}/${BPN}-${PV}.tar.xz \ | 16 | SRC_URI = "${GNOME_MIRROR}/${BPN}/${@oe.utils.trim_version("${PV}", 2)}/${BPN}-${PV}.tar.xz \ |
17 | file://0001-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch \ | ||
18 | file://0001-build-Avoid-the-doctemplates-hack.patch \ | 17 | file://0001-build-Avoid-the-doctemplates-hack.patch \ |
19 | " | 18 | " |
20 | 19 | ||
@@ -33,9 +32,7 @@ DEPENDS += " libffi zlib glib-2.0 python3 flex-native bison-native autoconf-arch | |||
33 | # target build needs qemu to run temporary introspection binaries created | 32 | # target build needs qemu to run temporary introspection binaries created |
34 | # on the fly by g-ir-scanner and a native version of itself to run | 33 | # on the fly by g-ir-scanner and a native version of itself to run |
35 | # native versions of its own tools during build. | 34 | # native versions of its own tools during build. |
36 | # Also prelink-rtld is used to find out library dependencies of introspection binaries | 35 | DEPENDS:append:class-target = " gobject-introspection-native qemu-native" |
37 | # (standard ldd doesn't work when cross-compiling). | ||
38 | DEPENDS:append:class-target = " gobject-introspection-native qemu-native prelink-native" | ||
39 | 36 | ||
40 | # needed for writing out the qemu wrapper script | 37 | # needed for writing out the qemu wrapper script |
41 | export STAGING_DIR_HOST | 38 | export STAGING_DIR_HOST |
@@ -55,13 +52,6 @@ EXTRA_OEMESON:class-target = " \ | |||
55 | ${@'-Dgir_dir_prefix=${libdir}' if d.getVar('MULTILIBS') else ''} \ | 52 | ${@'-Dgir_dir_prefix=${libdir}' if d.getVar('MULTILIBS') else ''} \ |
56 | " | 53 | " |
57 | 54 | ||
58 | # Need to ensure ld.so.conf exists so prelink-native works | ||
59 | # both before we build and if we install from sstate | ||
60 | do_configure[prefuncs] += "gobject_introspection_preconfigure" | ||
61 | python gobject_introspection_preconfigure () { | ||
62 | oe.utils.write_ld_so_conf(d) | ||
63 | } | ||
64 | |||
65 | do_configure:prepend:class-native() { | 55 | do_configure:prepend:class-native() { |
66 | # Tweak the native python scripts so that they don't refer to the | 56 | # Tweak the native python scripts so that they don't refer to the |
67 | # full path of native python binary (the solution is taken from glib-2.0 recipe) | 57 | # full path of native python binary (the solution is taken from glib-2.0 recipe) |
@@ -113,7 +103,7 @@ EOF | |||
113 | # for a different architecture | 103 | # for a different architecture |
114 | cat > ${B}/g-ir-scanner-lddwrapper << EOF | 104 | cat > ${B}/g-ir-scanner-lddwrapper << EOF |
115 | #!/bin/sh | 105 | #!/bin/sh |
116 | prelink-rtld --root=$STAGING_DIR_HOST "\$@" | 106 | $OBJDUMP -p "\$@" |
117 | EOF | 107 | EOF |
118 | chmod +x ${B}/g-ir-scanner-lddwrapper | 108 | chmod +x ${B}/g-ir-scanner-lddwrapper |
119 | 109 | ||