diff options
author | Artturin <Artturin@artturin.com> | 2022-07-27 23:41:52 +0300 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2022-07-28 00:09:35 +0300 |
commit | da1ea54ad82fee3b3f5a825cb4f7151457c87f01 (patch) | |
tree | 02699f8527a03fa79492df0e9a59868088a94715 /pkgs/development/libraries/gobject-introspection | |
parent | 9e58f0a78c6b285969440db97f9edb1eb8ddb7d5 (diff) |
gobject-introspection: use objdump -p instead of prelink-rtld
Commit msg of https://github.com/openembedded/openembedded-core/commit/767e0880d4d729e659e859dd99c1cdb084b8ba51 > 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. Additional context section of https://github.com/NixOS/nixpkgs/issues/183071 > prelink is dropped by openembedded, support for prelink is removed from glibc, > and itself is effectively abandoned by the upstream (yocto project). > I think we may as well drop it rather than fix it. > However gobject-introspection now relies on it as a runtime linker for use in cross compilation, we have to find an alternative.
Diffstat (limited to 'pkgs/development/libraries/gobject-introspection')
6 files changed, 18 insertions, 41 deletions
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index 896db9c467213..bb07d8c792cef 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -90,7 +90,13 @@ stdenv.mkDerivation (finalAttrs: { "-Dcairo=disabled" "-Dgtk_doc=${lib.boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}" ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-Dgi_cross_ldd_wrapper=${buildPackages.prelink}/bin/prelink-rtld" + "-Dgi_cross_ldd_wrapper=${substituteAll { + name = "g-ir-scanner-lddwrapper"; + isExecutable = true; + src = ./wrappers/g-ir-scanner-lddwrapper.sh; + inherit (buildPackages) bash; + buildobjdump = "${buildPackages.stdenv.cc.bintools}/bin/objdump"; + }}" "-Dgi_cross_use_prebuilt_gi=true" "-Dgi_cross_binary_wrapper=${stdenv.hostPlatform.emulator buildPackages}" ]; diff --git a/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch b/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch deleted file mode 100644 index bf1c1f1b713f8..0000000000000 --- a/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -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 <alex.kanavin@gmail.com> -Signed-off-by: Adam Duskett <aduskett@gmail.com> ---- - 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 - - diff --git a/pkgs/development/libraries/gobject-introspection/wrapper.nix b/pkgs/development/libraries/gobject-introspection/wrapper.nix index 9e8f20ce14660..4b3fa1a198199 100644 --- a/pkgs/development/libraries/gobject-introspection/wrapper.nix +++ b/pkgs/development/libraries/gobject-introspection/wrapper.nix @@ -18,24 +18,23 @@ in (gobject-introspection-unwrapped.override args).overrideAttrs (previousAttrs: { pname = "gobject-introspection-wrapped"; - # failure in e.g. pkgsCross.aarch64-multiplatform.polkit - # subprocess.CalledProcessError: Command '['/nix/store/...-prelink-unstable-2019-06-24/bin/prelink-rtld', '/build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0']' returned non-zero exit status 127. - patches = previousAttrs.patches ++ [ ./giscanner-ignore-error-return-codes-from-ldd-wrapper.patch ]; postFixup = (previousAttrs.postFixup or "") + '' mv $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped mv $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped ( - export bash="${buildPackages.bash}/bin/bash" + export bash="${buildPackages.bash}" export emulator=${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)} - export buildprelink="${buildPackages.prelink}/bin/prelink-rtld" + export buildobjdump="${buildPackages.stdenv.cc.bintools}/bin/objdump" export targetgir="${lib.getDev (targetPackages.gobject-introspection-unwrapped.override argsForTarget)}" substituteAll "${./wrappers/g-ir-compiler.sh}" "$dev/bin/g-ir-compiler" substituteAll "${./wrappers/g-ir-scanner.sh}" "$dev/bin/g-ir-scanner" + substituteAll "${./wrappers/g-ir-scanner-lddwrapper.sh}" "$dev/bin/g-ir-scanner-lddwrapper" chmod +x "$dev/bin/g-ir-compiler" chmod +x "$dev/bin/g-ir-scanner" + chmod +x "$dev/bin/g-ir-scanner-lddwrapper" ) '' # when cross-compiling and using the wrapper then when a package looks up the g_ir_X diff --git a/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-compiler.sh b/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-compiler.sh index fde3dcfe0c008..69642831c8a0f 100644 --- a/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-compiler.sh +++ b/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-compiler.sh @@ -1,4 +1,4 @@ -#! @bash@ +#! @bash@/bin/bash # shellcheck shell=bash exec @emulator@ @targetgir@/bin/g-ir-compiler "$@" diff --git a/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner-lddwrapper.sh b/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner-lddwrapper.sh new file mode 100644 index 0000000000000..1bf9c3659dc5c --- /dev/null +++ b/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner-lddwrapper.sh @@ -0,0 +1,4 @@ +#! @bash@/bin/bash +# shellcheck shell=bash + +exec @buildobjdump@ -p "$@" diff --git a/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner.sh b/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner.sh index 0825f10e166e9..6a222191c7b20 100644 --- a/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner.sh +++ b/pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner.sh @@ -1,7 +1,7 @@ -#! @bash@ +#! @bash@/bin/bash # shellcheck shell=bash exec @dev@/bin/.g-ir-scanner-wrapped \ --use-binary-wrapper=@emulator@ \ - --use-ldd-wrapper=@buildprelink@ \ + --use-ldd-wrapper=@dev@/bin/g-ir-scanner-lddwrapper \ "$@" |