File: 0018-pygrub-Specify-rpath-LIBEXEC_LIB-when-building-fsima.patch

package info (click to toggle)
xen 4.20.0%2B68-g35cb38b222-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 39,144 kB
  • sloc: ansic: 539,752; asm: 9,162; python: 7,986; sh: 7,667; makefile: 6,650; ml: 5,544; perl: 4,187; cpp: 1,885; lex: 828; yacc: 645; pascal: 533; awk: 274; xml: 51; exp: 39; sed: 4
file content (51 lines) | stat: -rw-r--r-- 1,746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From: Ian Jackson <ian.jackson@citrix.com>
Date: Fri, 22 Feb 2019 12:24:35 +0000
Subject: pygrub: Specify -rpath LIBEXEC_LIB when building fsimage.so

If LIBEXEC_LIB is not on the default linker search path, the python
fsimage.so module fails to find libfsimage.so.

Add the relevant directory to the rpath explicitly.

(This situation occurs in the Debian package, where
--with-libexec-libdir is used to put each Xen version's libraries and
utilities in their own directory, to allow them to be coinstalled.)

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
---
 tools/pygrub/Makefile | 1 +
 tools/pygrub/setup.py | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index d5e291e..03f089a 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -7,6 +7,7 @@ PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
 INSTALL_LOG = build/installed_files.txt
 
 setup.py = CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" \
+           LIBEXEC_LIB="$(LIBEXEC_LIB)" \
            $(PYTHON) setup.py
 
 .PHONY: all
diff --git a/tools/pygrub/setup.py b/tools/pygrub/setup.py
index be5d3ff..dcdce77 100644
--- a/tools/pygrub/setup.py
+++ b/tools/pygrub/setup.py
@@ -8,10 +8,15 @@ import sys
 
 extra_compile_args  = [ "-fno-strict-aliasing" ]
 
+extra_link_args = []
+try: extra_link_args += [ "-Wl,-rpath," + os.environ['LIBEXEC_LIB'] ]
+except KeyError: pass
+
 XEN_ROOT = "../.."
 
 xenfsimage = Extension("xenfsimage",
     extra_compile_args = extra_compile_args,
+    extra_link_args = extra_link_args,
     include_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
     library_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
     libraries = ["xenfsimage"],