From 5938f74ded1210131d04396065bb5cab7520a6a3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 8 Nov 2009 22:36:51 +0000 Subject: collect2.c (main): Search PLUGIN_LD for plugin linker. 2009-11-08 H.J. Lu * collect2.c (main): Search PLUGIN_LD for plugin linker. * configure.ac (--with-plugin-ld): New. Default to ld. * configure: Regenerated. * config.in: Likewise. * exec-tool.in (ORIGINAL_PLUGIN_LD_FOR_TARGET): New. (collect-ld): Use ORIGINAL_PLUGIN_LD_FOR_TARGET for -plugin. From-SVN: r154020 --- gcc/collect2.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gcc/collect2.c') diff --git a/gcc/collect2.c b/gcc/collect2.c index 03300f3..b259f09 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1100,6 +1100,7 @@ int main (int argc, char **argv) { static const char *const ld_suffix = "ld"; + static const char *const plugin_ld_suffix = PLUGIN_LD; static const char *const real_ld_suffix = "real-ld"; static const char *const collect_ld_suffix = "collect-ld"; static const char *const nm_suffix = "nm"; @@ -1118,6 +1119,8 @@ main (int argc, char **argv) const char *const full_ld_suffix = concat(target_machine, "-", ld_suffix, NULL); + const char *const full_plugin_ld_suffix = + concat(target_machine, "-", plugin_ld_suffix, NULL); const char *const full_nm_suffix = concat (target_machine, "-", nm_suffix, NULL); const char *const full_gnm_suffix = @@ -1132,6 +1135,7 @@ main (int argc, char **argv) concat (target_machine, "-", gstrip_suffix, NULL); #else const char *const full_ld_suffix = ld_suffix; + const char *const full_plugin_ld_suffix = plugin_ld_suffix; const char *const full_nm_suffix = nm_suffix; const char *const full_gnm_suffix = gnm_suffix; #ifdef LDD_SUFFIX @@ -1152,6 +1156,7 @@ main (int argc, char **argv) const char **c_ptr; char **ld1_argv; const char **ld1; + bool use_plugin = false; /* The kinds of symbols we will have to consider when scanning the outcome of a first pass link. This is ALL to start with, then might @@ -1217,7 +1222,6 @@ main (int argc, char **argv) what LTO mode we are in. */ { int i; - bool use_plugin = false; for (i = 1; argv[i] != NULL; i ++) { @@ -1329,11 +1333,17 @@ main (int argc, char **argv) /* Search the compiler directories for `ld'. We have protection against recursive calls in find_a_file. */ if (ld_file_name == 0) - ld_file_name = find_a_file (&cpath, ld_suffix); + ld_file_name = find_a_file (&cpath, + use_plugin + ? plugin_ld_suffix + : ld_suffix); /* Search the ordinary system bin directories for `ld' (if native linking) or `TARGET-ld' (if cross). */ if (ld_file_name == 0) - ld_file_name = find_a_file (&path, full_ld_suffix); + ld_file_name = find_a_file (&path, + use_plugin + ? full_plugin_ld_suffix + : full_ld_suffix); #ifdef REAL_NM_FILE_NAME nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME); -- cgit v1.1