summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/cc.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py
index 0b1aeb2a8f..594cd6efe9 100644
--- a/lib/spack/spack/test/cc.py
+++ b/lib/spack/spack/test/cc.py
@@ -219,3 +219,27 @@ class CompilerTest(unittest.TestCase):
' '.join(test_command))
+ def test_ld_deps_reentrant(self):
+ """Make sure ld -r is handled correctly on OS's where it doesn't
+ support rpaths."""
+ os.environ['SPACK_DEPENDENCIES'] = ':'.join([self.dep1])
+
+ os.environ['SPACK_SHORT_SPEC'] = "foo@1.2=linux-x86_64"
+ reentrant_test_command = ['-r'] + test_command
+ self.check_ld('dump-args', reentrant_test_command,
+ 'ld ' +
+ '-rpath ' + self.prefix + '/lib ' +
+ '-rpath ' + self.prefix + '/lib64 ' +
+
+ '-L' + self.dep1 + '/lib ' +
+ '-rpath ' + self.dep1 + '/lib ' +
+
+ '-r ' +
+ ' '.join(test_command))
+
+ os.environ['SPACK_SHORT_SPEC'] = "foo@1.2=darwin-x86_64"
+ self.check_ld('dump-args', reentrant_test_command,
+ 'ld ' +
+ '-L' + self.dep1 + '/lib ' +
+ '-r ' +
+ ' '.join(test_command))