summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2017-03-02 16:39:05 -0600
committerAdam J. Stewart <ajstewart426@gmail.com>2017-03-02 16:39:05 -0600
commit4afb7a729c2886a25809d2c00d78f99f6e4286fa (patch)
treeacaa14a8d58ba8d08ff7126e4dd7475d4044658f
parent7baefa83b9d4083f13b0e085d02e4ae9b27cd9e0 (diff)
downloadspack-4afb7a729c2886a25809d2c00d78f99f6e4286fa.tar.gz
spack-4afb7a729c2886a25809d2c00d78f99f6e4286fa.tar.bz2
spack-4afb7a729c2886a25809d2c00d78f99f6e4286fa.tar.xz
spack-4afb7a729c2886a25809d2c00d78f99f6e4286fa.zip
Make libgcc_s relocatable on Macos by adding @rpath to installname (#1671)
* Make libgcc_s relocatable * spack specifies full path to lib64 * don't need trailing / * setting rpath is different on macos * add -headerpad_max_install_names linker options * formatting fixes * Add Adam's recommendation
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index a9fed4d8dd..c005cd581a 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -92,6 +92,10 @@ class Gcc(AutotoolsPackage):
filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure',
string=True)
+ # Make libgcc_s relocatable
+ filter_file(r"@shlib_slibdir@", "@rpath",
+ 'libgcc/config/t-slibgcc-darwin', string=True)
+
enabled_languages = set(('c', 'c++', 'fortran', 'java', 'objc'))
if spec.satisfies("@4.7.1:") and sys.platform != 'darwin' and \
@@ -172,6 +176,11 @@ class Gcc(AutotoolsPackage):
for line in lines:
out.write(line + "\n")
if line.startswith("*link:"):
- out.write("-rpath %s/lib:%s/lib64 \\\n" %
- (self.prefix, self.prefix))
+ if sys.platform == 'darwin':
+ out.write("-rpath %s/lib -rpath %s/lib64 "
+ r"-headerpad_max_install_names \n" %
+ (self.prefix, self.prefix))
+ else:
+ out.write(r"-rpath %s/lib:%s/lib64 \n" %
+ (self.prefix, self.prefix))
set_install_permissions(specs_file)