diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 88c2faeb6ab..e5d9f9a3906 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -1174,7 +1174,7 @@ def _post_buildcache_install_hook(self): os.path.exists(os.path.join(header_dir, h)) for h in libc.package_class.representative_headers ): - relocation_args.append(f"-isystem {header_dir}") + relocation_args.append(f"-idirafter {header_dir}") else: tty.warn( f"Cannot relocate {specs_file} include directories, "