aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJames Hilliard <james.hilliard1@gmail.com>2020-07-18 17:01:33 -0600
committerJussi Pakkanen <jpakkane@gmail.com>2020-07-30 16:36:11 +0300
commit1ce4258c219fe08b6d6eaa6aa944f27d91d054cb (patch)
tree7b5d804fca5f7cab66878e435f2c169164c85576 /run_unittests.py
parentbc2338efd33dce9f07ecc2942e090f56006596e8 (diff)
downloadmeson-1ce4258c219fe08b6d6eaa6aa944f27d91d054cb.zip
meson-1ce4258c219fe08b6d6eaa6aa944f27d91d054cb.tar.gz
meson-1ce4258c219fe08b6d6eaa6aa944f27d91d054cb.tar.bz2
backends: fix rpath match pattern
Since -Wl,-rpath= is not the only valid rpath ldflags syntax we need to try and match all valid rpath ldflags. In addition we should prevent -Wl,--just-symbols from being used to set rpath due to inconsistent compiler support. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py39
1 files changed, 27 insertions, 12 deletions
diff --git a/run_unittests.py b/run_unittests.py
index b5294b9..73131c7 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -6473,19 +6473,34 @@ class LinuxlikeTests(BasePlatformTests):
self.init(yonder_dir)
self.build()
self.install(use_destdir=False)
- self.new_builddir()
- # Build an app that uses that installed library.
- # Supply the rpath to the installed library via LDFLAGS
- # (as systems like buildroot and guix are wont to do)
- # and verify install preserves that rpath.
- env = {'LDFLAGS': '-Wl,-rpath=' + yonder_libdir,
- 'PKG_CONFIG_PATH': os.path.join(yonder_libdir, 'pkgconfig')}
- self.init(testdir, override_envvars=env)
- self.build()
- self.install(use_destdir=False)
- got_rpath = get_rpath(os.path.join(yonder_prefix, 'bin/rpathified'))
- self.assertEqual(got_rpath, yonder_libdir)
+ # Since rpath has multiple valid formats we need to
+ # test that they are all properly used.
+ rpath_formats = [
+ ('-Wl,-rpath=', False),
+ ('-Wl,-rpath,', False),
+ ('-Wl,--just-symbols=', True),
+ ('-Wl,--just-symbols,', True),
+ ('-Wl,-R', False),
+ ('-Wl,-R,', False)
+ ]
+ for rpath_format, exception in rpath_formats:
+ # Build an app that uses that installed library.
+ # Supply the rpath to the installed library via LDFLAGS
+ # (as systems like buildroot and guix are wont to do)
+ # and verify install preserves that rpath.
+ self.new_builddir()
+ env = {'LDFLAGS': rpath_format + yonder_libdir,
+ 'PKG_CONFIG_PATH': os.path.join(yonder_libdir, 'pkgconfig')}
+ if exception:
+ with self.assertRaises(subprocess.CalledProcessError):
+ self.init(testdir, override_envvars=env)
+ break
+ self.init(testdir, override_envvars=env)
+ self.build()
+ self.install(use_destdir=False)
+ got_rpath = get_rpath(os.path.join(yonder_prefix, 'bin/rpathified'))
+ self.assertEqual(got_rpath, yonder_libdir, rpath_format)
@skip_if_not_base_option('b_sanitize')
def test_pch_with_address_sanitizer(self):