gcc: write builtin specs before modifications (#43956)
This commit is contained in:
		| @@ -980,17 +980,18 @@ def write_specs_file(self): | |||||||
| 
 | 
 | ||||||
|         specs_file = join_path(self.spec_dir, "specs") |         specs_file = join_path(self.spec_dir, "specs") | ||||||
|         with open(specs_file, "w") as f: |         with open(specs_file, "w") as f: | ||||||
|  |             # can't extend the builtins without dumping them first | ||||||
|  |             f.write(self.spec["gcc"].command("-dumpspecs", output=str, error=os.devnull).strip()) | ||||||
|  | 
 | ||||||
|  |             f.write("\n\n# Generated by Spack\n\n") | ||||||
|  | 
 | ||||||
|             # rpath |             # rpath | ||||||
|             if rpath_dir: |             if rpath_dir: | ||||||
|                 print("*link_libgcc:", file=f) |                 f.write(f"*link_libgcc:\n+ -rpath={rpath_dir}\n\n") | ||||||
|                 print(f"+ -rpath={rpath_dir}", file=f) |  | ||||||
|                 print(file=f) |  | ||||||
| 
 | 
 | ||||||
|             # programs search path |             # programs search path | ||||||
|             if self.spec.satisfies("+binutils"): |             if self.spec.satisfies("+binutils"): | ||||||
|                 print("*self_spec:", file=f) |                 f.write(f"*self_spec:\n+ -B{self.spec['binutils'].prefix.bin}\n\n") | ||||||
|                 print(f"+ -B{self.spec['binutils'].prefix.bin}", file=f) |  | ||||||
|                 print(file=f) |  | ||||||
|         set_install_permissions(specs_file) |         set_install_permissions(specs_file) | ||||||
|         tty.info(f"Wrote new spec file to {specs_file}") |         tty.info(f"Wrote new spec file to {specs_file}") | ||||||
| 
 | 
 | ||||||
| @@ -1210,6 +1211,4 @@ def _post_buildcache_install_hook(self): | |||||||
| 
 | 
 | ||||||
|         if relocation_args: |         if relocation_args: | ||||||
|             with open(specs_file, "a") as f: |             with open(specs_file, "a") as f: | ||||||
|                 print("*self_spec:", file=f) |                 f.write(f"*self_spec:\n+ {' '.join(relocation_args)}\n\n") | ||||||
|                 print(f"+ {' '.join(relocation_args)}", file=f) |  | ||||||
|                 print(file=f) |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Harmen Stoppels
					Harmen Stoppels