meson: prevent RPATH stripping
By default, Meson strips RPATH from the executable it builds [1,2], unless explicitly set via install_rpath. This will make support/scripts/check-host-rpath fail when building the host variant of a Meson-based package. So add a patch to prevent RPATH from being stripped if install_rpath is not set and notify user about it. [1] https://github.com/mesonbuild/meson/issues/2567 [2] https://github.com/mesonbuild/meson/issues/314#issuecomment-157658562 Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
12e56136e2
commit
7a23af4773
@ -0,0 +1,32 @@
|
||||
From 53e4920038d5562b7b672fec8b9469fc02eef4ad Mon Sep 17 00:00:00 2001
|
||||
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
|
||||
Date: Thu, 10 May 2018 21:57:49 +0200
|
||||
Subject: [PATCH] Only fix RPATH if install_rpath is not empty
|
||||
|
||||
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
|
||||
---
|
||||
mesonbuild/scripts/meson_install.py | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
|
||||
index 013f2a00..f7ff1dcc 100644
|
||||
--- a/mesonbuild/scripts/meson_install.py
|
||||
+++ b/mesonbuild/scripts/meson_install.py
|
||||
@@ -368,7 +368,13 @@ def install_targets(d):
|
||||
printed_symlink_error = True
|
||||
if os.path.isfile(outname):
|
||||
try:
|
||||
- depfixer.fix_rpath(outname, install_rpath, False)
|
||||
+ # Buildroot check-host-rpath script expects RPATH
|
||||
+ # But if install_rpath is empty, it will stripped.
|
||||
+ # So, preserve it in this case
|
||||
+ if install_rpath:
|
||||
+ depfixer.fix_rpath(outname, install_rpath, False)
|
||||
+ else:
|
||||
+ print("Skipping RPATH fixing")
|
||||
except SystemExit as e:
|
||||
if isinstance(e.code, int) and e.code == 0:
|
||||
pass
|
||||
--
|
||||
2.14.3
|
||||
|
Loading…
Reference in New Issue
Block a user