diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index ddc303bfdb..3d0f2caff5 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -122,12 +122,11 @@ def write_rpath_specs(self): return gcc = Executable(join_path(self.prefix.bin, 'gcc')) - lines = gcc('-dumpspecs', return_output=True).split("\n") + lines = gcc('-dumpspecs', return_output=True).strip().split("\n") specs_file = join_path(self.spec_dir, 'specs') with closing(open(specs_file, 'w')) as out: for line in lines: - if line.startswith("*link:"): - out.write(line + "\n") - out.write("-rpath %s/lib:%s/lib64 \\\n"% (self.prefix, self.prefix)) out.write(line + "\n") + if line.startswith("*link:"): + out.write("-rpath %s/lib:%s/lib64 \\\n"% (self.prefix, self.prefix)) set_install_permissions(specs_file)