Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From eba2b999e81d81b5f43bb1f0ab33881786bebdec Mon Sep 17 00:00:00 2001 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Fri, 30 Oct 2015 16:28:46 +0200 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 4 | Subject: [PATCH] giscanner: add a --use-ldd-wrapper option |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 5 | |
| 6 | This is useful in cross-compile environments where system's ldd |
| 7 | command does not work on binaries built for a different architecture |
| 8 | |
| 9 | Upstream-Status: Pending [review in oe-core] |
| 10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 11 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 12 | --- |
| 13 | giscanner/scannermain.py | 3 +++ |
| 14 | giscanner/shlibs.py | 4 +++- |
| 15 | 2 files changed, 6 insertions(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 18 | index 061def0..5cb793e 100644 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 19 | --- a/giscanner/scannermain.py |
| 20 | +++ b/giscanner/scannermain.py |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 21 | @@ -129,6 +129,9 @@ def _get_option_parser(): |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 22 | parser.add_option("", "--use-binary-wrapper", |
| 23 | action="store", dest="wrapper", default=None, |
| 24 | help="wrapper to use for running programs (useful when cross-compiling)") |
| 25 | + parser.add_option("", "--use-ldd-wrapper", |
| 26 | + action="store", dest="ldd_wrapper", default=None, |
| 27 | + help="wrapper to use instead of ldd (useful when cross-compiling)") |
| 28 | parser.add_option("", "--program-arg", |
| 29 | action="append", dest="program_args", default=[], |
| 30 | help="extra arguments to program") |
| 31 | diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 32 | index 7b7b2d0..01d21a3 100644 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | --- a/giscanner/shlibs.py |
| 34 | +++ b/giscanner/shlibs.py |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 35 | @@ -102,7 +102,9 @@ def _resolve_non_libtool(options, binary, libraries): |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 36 | args.extend(libtool) |
| 37 | args.append('--mode=execute') |
| 38 | platform_system = platform.system() |
| 39 | - if platform_system == 'Darwin': |
| 40 | + if options.ldd_wrapper: |
| 41 | + args.extend([options.ldd_wrapper, binary.args[0]]) |
| 42 | + elif platform_system == 'Darwin': |
| 43 | args.extend(['otool', '-L', binary.args[0]]) |
| 44 | else: |
| 45 | args.extend(['ldd', binary.args[0]]) |