Skip to contentSkip to conversation

package/gobject-introspection: use objdump instead of prelink-cross

PATCH Applied Thomas Petazzoni via buildroot 2 participants 3 messages Aug 25, 2024 – Aug 30, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gobject-introspection: use objdump instead of prelink-cross

This commit switches the gobject-introspection package from using prelink-cross to simply using "objdump -p". This basically implements the same change as was done in OpenEmbedded commit:

https://git.openembedded.org/openembedded-core/commit/?id=767e0880d4d729e659e859dd99c1cdb084b8ba51

In particular, this allows to get rid of the architecture dependency of prelink-cross, which wasn't currently encoded, but that was actually causing failures such as:

/home/autobuild/autobuild/instance-17/output-1/host/sbin/prelink-rtld: error while loading shared libraries: /lib/libc.so.6: cannot handle TLS data

It also paves the way for removing host-prelink-cross entirely, as the only remaining user of it now is dracut.

The test tests.package.test_python_gobject.TestPythonPy3Gobject (which uses gobject-introspection) has been tested to run fine after this commit.

Fixes:

http://autobuild.buildroot.net/results/7efa6a18f543752dfe33577f74c20bda3f8b1e65/

---
 .checkpackageignore                           |  1 -
 ...-error-return-codes-from-ldd-wrapper.patch | 31 -------------------
 .../g-ir-scanner-lddwrapper.in                |  3 +-
 .../gobject-introspection.mk                  |  3 +-
 4 files changed, 3 insertions(+), 35 deletions(-)
 delete mode 100644 package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch
.checkpackageignore +0 -1
index 81e48bf859..4b1bd6a42e 100644
@@ -586,7 +586,6 @@ package/go/go-src/0001-build.go-explicit-option-for-crosscompilation.patch lib_p
 package/gob2/0001-dont-include-from-prefix.patch lib_patch.Upstream
 package/gobject-introspection/0001-disable-tests.patch lib_patch.Upstream
 package/gobject-introspection/0002-Add-rpath-links-to-ccompiler.patch lib_patch.Upstream
-package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch lib_patch.Upstream
 package/gpsd/S50gpsd Shellcheck lib_sysv.Indent lib_sysv.Variables
 package/gptfdisk/0001-gptcurses-partially-revert-Tweaks-for-building-on-th.patch lib_patch.Upstream
 package/graphite2/0001-don-t-install-a-libtool-file-with-static-library.patch lib_patch.Upstream
package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch deleted +0 -31
deleted file mode 100644
index f1ea518954..0000000000
@@ -1,31 +0,0 @@
-From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Wed, 5 Sep 2018 16:46:52 +0200
-Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper
-
-prelink-rtld, which we use instead of ldd returns 127 when it can't find a library.
-It is not an error per se, but it breaks subprocess.check_output().
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <[email protected]>
-Signed-off-by: Adam Duskett <[email protected]>
----
- giscanner/shlibs.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
-index 9f8ab5df..7a1a72fe 100644
---- a/giscanner/shlibs.py
-+++ b/giscanner/shlibs.py
-@@ -103,7 +103,7 @@ def _resolve_non_libtool(options, binary, libraries):
-             args.extend(['otool', '-L', binary.args[0]])
-         else:
-             args.extend(['ldd', binary.args[0]])
--        output = subprocess.check_output(args)
-+        output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout
-         if isinstance(output, bytes):
-             output = output.decode("utf-8", "replace")
- 
--- 
-2.25.1
-
package/gobject-introspection/g-ir-scanner-lddwrapper.in +1 -2
index 2f09bca77a..7f3db67da4 100644
@@ -1,3 +1,2 @@
 #!/usr/bin/env sh
-
-"${HOST_DIR}"/sbin/prelink-rtld --root="$(dirname "$0")/../../" "$@"
+@TARGET_OBJDUMP@ -p "$@"
package/gobject-introspection/gobject-introspection.mk +2 -1
index f0c7fcd2ca..ad72af22a2 100644
@@ -15,7 +15,6 @@ GOBJECT_INTROSPECTION_LICENSE_FILES = COPYING.LGPL COPYING.GPL giscanner/scanner
 GOBJECT_INTROSPECTION_DEPENDENCIES = \
 	host-autoconf-archive \
 	host-gobject-introspection \
-	host-prelink-cross \
 	host-qemu \
 	libffi \
 	libglib2 \
@@ -78,6 +77,8 @@ define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
 
 	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-lddwrapper.in \
 		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
+	$(SED) "s%@TARGET_OBJDUMP@%$(TARGET_OBJDUMP)%" \
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
 
 	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-qemuwrapper.in \
 		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
Signature · 6 lines
2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author Tested-by Fiona Klute (WIWA) on v1 1/1
#1 lore raw

Am 25.08.24 um 11:25 schrieb Thomas Petazzoni:

Quoted 19 lines

This commit switches the gobject-introspection package from using prelink-cross to simply using "objdump -p". This basically implements the same change as was done in OpenEmbedded commit:

   https://git.openembedded.org/openembedded-core/commit/?id=767e0880d4d729e659e859dd99c1cdb084b8ba51

In particular, this allows to get rid of the architecture dependency of prelink-cross, which wasn't currently encoded, but that was actually causing failures such as:

/home/autobuild/autobuild/instance-17/output-1/host/sbin/prelink-rtld: error while loading shared libraries: /lib/libc.so.6: cannot handle TLS data

It also paves the way for removing host-prelink-cross entirely, as the only remaining user of it now is dracut.

The test tests.package.test_python_gobject.TestPythonPy3Gobject (which uses gobject-introspection) has been tested to run fine after this commit.

Quoted 5 lines

Fixes:

   http://autobuild.buildroot.net/results/7efa6a18f543752dfe33577f74c20bda3f8b1e65/

Tested with aarch64/musl target, both with and without my pending libglib2/gobject-introspection update series.

Thanks,
Fiona

Quoted 79 lines
---
  .checkpackageignore                           |  1 -
  ...-error-return-codes-from-ldd-wrapper.patch | 31 -------------------
  .../g-ir-scanner-lddwrapper.in                |  3 +-
  .../gobject-introspection.mk                  |  3 +-
  4 files changed, 3 insertions(+), 35 deletions(-)

delete mode 100644 package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch

.checkpackageignore +0 -1
index 81e48bf859..4b1bd6a42e 100644
@@ -586,7 +586,6 @@ package/go/go-src/0001-build.go-explicit-option-for-crosscompilation.patch lib_p
  package/gob2/0001-dont-include-from-prefix.patch lib_patch.Upstream
  package/gobject-introspection/0001-disable-tests.patch lib_patch.Upstream
  package/gobject-introspection/0002-Add-rpath-links-to-ccompiler.patch lib_patch.Upstream
-package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch lib_patch.Upstream
  package/gpsd/S50gpsd Shellcheck lib_sysv.Indent lib_sysv.Variables
  package/gptfdisk/0001-gptcurses-partially-revert-Tweaks-for-building-on-th.patch lib_patch.Upstream
  package/graphite2/0001-don-t-install-a-libtool-file-with-static-library.patch lib_patch.Upstream
package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch deleted +0 -31
deleted file mode 100644
index f1ea518954..0000000000
@@ -1,31 +0,0 @@
-From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Wed, 5 Sep 2018 16:46:52 +0200
-Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper
-
-prelink-rtld, which we use instead of ldd returns 127 when it can't find a library.
-It is not an error per se, but it breaks subprocess.check_output().
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <[email protected]>
-Signed-off-by: Adam Duskett <[email protected]>
----
- giscanner/shlibs.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
-index 9f8ab5df..7a1a72fe 100644
---- a/giscanner/shlibs.py
-+++ b/giscanner/shlibs.py
-@@ -103,7 +103,7 @@ def _resolve_non_libtool(options, binary, libraries):
-             args.extend(['otool', '-L', binary.args[0]])
-         else:
-             args.extend(['ldd', binary.args[0]])
--        output = subprocess.check_output(args)
-+        output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout
-         if isinstance(output, bytes):
-             output = output.decode("utf-8", "replace")
-
---
-2.25.1
-
package/gobject-introspection/g-ir-scanner-lddwrapper.in +1 -2
index 2f09bca77a..7f3db67da4 100644
@@ -1,3 +1,2 @@
  #!/usr/bin/env sh
-
-"${HOST_DIR}"/sbin/prelink-rtld --root="$(dirname "$0")/../../" "$@"
+@TARGET_OBJDUMP@ -p "$@"
package/gobject-introspection/gobject-introspection.mk +0 -1
index f0c7fcd2ca..ad72af22a2 100644
@@ -15,7 +15,6 @@ GOBJECT_INTROSPECTION_LICENSE_FILES = COPYING.LGPL COPYING.GPL giscanner/scanner
  GOBJECT_INTROSPECTION_DEPENDENCIES = \
  	host-autoconf-archive \
  	host-gobject-introspection \
-	host-prelink-cross \
  	host-qemu \
  	libffi \
  	libglib2 \

package/gobject-introspection/gobject-introspection.mk define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS · line 84

Quoted 8 lines
package/gobject-introspection/gobject-introspection.mk +2 -0
@@ -78,6 +77,8 @@ define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
 
  	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-lddwrapper.in \
  		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
+	$(SED) "s%@TARGET_OBJDUMP@%$(TARGET_OBJDUMP)%" \
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
 
  	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-qemuwrapper.in \
  		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Thomas Petazzoni via buildroot

Thomas, All,

On 2024-08-25 11:25 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 19 lines

This commit switches the gobject-introspection package from using prelink-cross to simply using "objdump -p". This basically implements the same change as was done in OpenEmbedded commit:

https://git.openembedded.org/openembedded-core/commit/?id=767e0880d4d729e659e859dd99c1cdb084b8ba51

In particular, this allows to get rid of the architecture dependency of prelink-cross, which wasn't currently encoded, but that was actually causing failures such as:

/home/autobuild/autobuild/instance-17/output-1/host/sbin/prelink-rtld: error while loading shared libraries: /lib/libc.so.6: cannot handle TLS data

It also paves the way for removing host-prelink-cross entirely, as the only remaining user of it now is dracut.

The test tests.package.test_python_gobject.TestPythonPy3Gobject (which uses gobject-introspection) has been tested to run fine after this commit.

Quoted 5 lines

Fixes:

http://autobuild.buildroot.net/results/7efa6a18f543752dfe33577f74c20bda3f8b1e65/

Applied to next, thanks.

Regards,
Yann E. MORIN.

Quoted 94 lines
---
 .checkpackageignore                           |  1 -
 ...-error-return-codes-from-ldd-wrapper.patch | 31 -------------------
 .../g-ir-scanner-lddwrapper.in                |  3 +-
 .../gobject-introspection.mk                  |  3 +-
 4 files changed, 3 insertions(+), 35 deletions(-)
 delete mode 100644 package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch
.checkpackageignore +0 -1
index 81e48bf859..4b1bd6a42e 100644
@@ -586,7 +586,6 @@ package/go/go-src/0001-build.go-explicit-option-for-crosscompilation.patch lib_p
 package/gob2/0001-dont-include-from-prefix.patch lib_patch.Upstream
 package/gobject-introspection/0001-disable-tests.patch lib_patch.Upstream
 package/gobject-introspection/0002-Add-rpath-links-to-ccompiler.patch lib_patch.Upstream
-package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch lib_patch.Upstream
 package/gpsd/S50gpsd Shellcheck lib_sysv.Indent lib_sysv.Variables
 package/gptfdisk/0001-gptcurses-partially-revert-Tweaks-for-building-on-th.patch lib_patch.Upstream
 package/graphite2/0001-don-t-install-a-libtool-file-with-static-library.patch lib_patch.Upstream
package/gobject-introspection/0003-giscanner-ignore-error-return-codes-from-ldd-wrapper.patch deleted +0 -31
deleted file mode 100644
index f1ea518954..0000000000
@@ -1,31 +0,0 @@
-From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Wed, 5 Sep 2018 16:46:52 +0200
-Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper
-
-prelink-rtld, which we use instead of ldd returns 127 when it can't find a library.
-It is not an error per se, but it breaks subprocess.check_output().
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <[email protected]>
-Signed-off-by: Adam Duskett <[email protected]>
----
- giscanner/shlibs.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
-index 9f8ab5df..7a1a72fe 100644
---- a/giscanner/shlibs.py
-+++ b/giscanner/shlibs.py
-@@ -103,7 +103,7 @@ def _resolve_non_libtool(options, binary, libraries):
-             args.extend(['otool', '-L', binary.args[0]])
-         else:
-             args.extend(['ldd', binary.args[0]])
--        output = subprocess.check_output(args)
-+        output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout
-         if isinstance(output, bytes):
-             output = output.decode("utf-8", "replace")
- 
--- 
-2.25.1
-
package/gobject-introspection/g-ir-scanner-lddwrapper.in +1 -2
index 2f09bca77a..7f3db67da4 100644
@@ -1,3 +1,2 @@
 #!/usr/bin/env sh
-
-"${HOST_DIR}"/sbin/prelink-rtld --root="$(dirname "$0")/../../" "$@"
+@TARGET_OBJDUMP@ -p "$@"
package/gobject-introspection/gobject-introspection.mk +2 -1
index f0c7fcd2ca..ad72af22a2 100644
@@ -15,7 +15,6 @@ GOBJECT_INTROSPECTION_LICENSE_FILES = COPYING.LGPL COPYING.GPL giscanner/scanner
 GOBJECT_INTROSPECTION_DEPENDENCIES = \
 	host-autoconf-archive \
 	host-gobject-introspection \
-	host-prelink-cross \
 	host-qemu \
 	libffi \
 	libglib2 \
@@ -78,6 +77,8 @@ define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
 
 	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-lddwrapper.in \
 		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
+	$(SED) "s%@TARGET_OBJDUMP@%$(TARGET_OBJDUMP)%" \
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
 
 	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-qemuwrapper.in \
 		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
Signature · 6 lines
2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot