summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/linkers/linkers.py12
-rw-r--r--test cases/unit/10 build_rpath/meson.build6
2 files changed, 14 insertions, 4 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index 705e42821..176fb3348 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -720,8 +720,10 @@ class GnuLikeDynamicLinkerMixin(DynamicLinkerBase):
# In order to avoid relinking for RPATH removal, the binary needs to contain just
# enough space in the ELF header to hold the final installation RPATH.
paths = ':'.join(all_paths)
- if len(paths) < len(install_rpath):
- padding = 'X' * (len(install_rpath) - len(paths))
+ paths_length = len(paths.encode('utf-8'))
+ install_rpath_length = len(install_rpath.encode('utf-8'))
+ if paths_length < install_rpath_length:
+ padding = 'X' * (install_rpath_length - paths_length)
if not paths:
paths = padding
else:
@@ -1488,8 +1490,10 @@ class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
# In order to avoid relinking for RPATH removal, the binary needs to contain just
# enough space in the ELF header to hold the final installation RPATH.
paths = ':'.join(all_paths)
- if len(paths) < len(install_rpath):
- padding = 'X' * (len(install_rpath) - len(paths))
+ paths_length = len(paths.encode('utf-8'))
+ install_rpath_length = len(install_rpath.encode('utf-8'))
+ if paths_length < install_rpath_length:
+ padding = 'X' * (install_rpath_length - paths_length)
if not paths:
paths = padding
else:
diff --git a/test cases/unit/10 build_rpath/meson.build b/test cases/unit/10 build_rpath/meson.build
index c0bc3bd27..f53c0f8bd 100644
--- a/test cases/unit/10 build_rpath/meson.build
+++ b/test cases/unit/10 build_rpath/meson.build
@@ -8,6 +8,12 @@ executable('prog', 'prog.c',
install : true,
)
+executable('multibyte_rpath', 'prog.c',
+ link_with: l,
+ install_rpath: get_option('prefix') / '⢖⢖⢖⢖⢖',
+ install: true
+ )
+
executable('progcxx', 'prog.cc',
link_with : l,
build_rpath : '/foo/bar',