%l process LINK_SPEC as a spec.
%L process LIB_SPEC as a spec.
%M Output multilib_os_dir.
+ %P Output a RUNPATH_OPTION for each directory in startfile_prefixes.
%G process LIBGCC_SPEC as a spec.
%R Output the concatenation of target_system_root and
target_sysroot_suffix.
# define SYSROOT_HEADERS_SUFFIX_SPEC ""
#endif
+#ifndef RUNPATH_OPTION
+# define RUNPATH_OPTION "-rpath"
+#endif
+
static const char *asm_debug = ASM_DEBUG_SPEC;
static const char *asm_debug_option = ASM_DEBUG_OPTION_SPEC;
static const char *cpp_spec = CPP_SPEC;
size_t append_len;
bool omit_relative;
bool separate_options;
+ bool realpaths;
};
static void *
size_t len = 0;
char save = 0;
+ /* The path must exist; we want to resolve it to the realpath so that this
+ can be embedded as a runpath. */
+ if (info->realpaths)
+ path = lrealpath (path);
+
+ /* However, if we failed to resolve it - perhaps because there was a bogus
+ -B option on the command line, then punt on this entry. */
+ if (!path)
+ return NULL;
+
if (info->omit_relative && !IS_ABSOLUTE_PATH (path))
return NULL;
info.omit_relative = false;
#endif
info.separate_options = false;
+ info.realpaths = false;
+
+ for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
+ }
+ break;
+
+ case 'P':
+ {
+ struct spec_path_info info;
+
+ info.option = RUNPATH_OPTION;
+ info.append_len = 0;
+ info.omit_relative = false;
+ info.separate_options = true;
+ /* We want to embed the actual paths that have the libraries. */
+ info.realpaths = true;
for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
}
info.append_len = strlen (info.append);
info.omit_relative = false;
info.separate_options = true;
+ info.realpaths = false;
for_each_path (&include_prefixes, false, info.append_len,
spec_path, &info);