* gcc.c (main): Don't run collect2 if we don't need to, as it slows down compiles. (process_command): Set repo_flag when -frepo is seen. (repo_flag): Add. * doc/invoke.texi (-frepo): Add documentation explaining that -frepo is necessary on the link step for some compiles. * tlink.c (scan_linker_output): Add support for darwin linker, as it emits unresolved symbols one per line, consuming entire line. *** ./doc/invoke.texi.~1~ Tue May 20 16:42:53 2003 --- ./doc/invoke.texi Thu May 22 11:46:27 2003 *************** option are superseded by @option{-pedant *** 1420,1428 **** @item -frepo @opindex frepo ! Enable automatic template instantiation at link time. This option also ! implies @option{-fno-implicit-templates}. @xref{Template ! Instantiation}, for more information. @item -fno-rtti @opindex fno-rtti --- 1420,1430 ---- @item -frepo @opindex frepo ! Enable automatic template instantiation at link time. This option ! also implies @option{-fno-implicit-templates}. @option{-frepo} must ! be given on any command line that implies linking, if there are any ! templates that need instantiation from the @file{.rpo} files. ! @xref{Template Instantiation}, for more information. @item -fno-rtti @opindex fno-rtti *** ./gcc.c.~1~ Tue May 20 16:42:01 2003 --- ./gcc.c Thu May 22 11:48:22 2003 *************** static int save_temps_flag; *** 222,227 **** --- 222,232 ---- static int use_pipes; + /* Nonzero means -frepo was seen, and in that case, we must run + collect2, if availible. */ + + static int repo_flag = 0; + /* The compiler version. */ static const char *compiler_version; *************** warranty; not even for MERCHANTABILITY o *** 3539,3544 **** --- 3544,3554 ---- verbose_only_flag++; verbose_flag++; } + else if (strcmp (argv[i], "-frepo") == 0) + { + repo_flag = 1; + n_switches++; + } else if (argv[i][0] == '-' && argv[i][1] != 0) { const char *p = &argv[i][1]; *************** main (argc, argv) *** 6341,6347 **** /* We'll use ld if we can't find collect2. */ if (! strcmp (linker_name_spec, "collect2")) { ! char *s = find_a_file (&exec_prefixes, "collect2", X_OK, 0); if (s == NULL) linker_name_spec = "ld"; } --- 6351,6366 ---- /* We'll use ld if we can't find collect2. */ if (! strcmp (linker_name_spec, "collect2")) { ! char *s = NULL; ! ! #ifndef USE_COLLECT2 ! /* On a system that doesn't define USE_COLLECT2, we don't run collect2 ! for any reason other than -frepo. */ ! /* If we have no other reason to run collect2, don't. */ ! if (repo_flag) ! #endif ! s = find_a_file (&exec_prefixes, "collect2", X_OK, 0); ! if (s == NULL) linker_name_spec = "ld"; } *** ./tlink.c.~1~ Mon Apr 28 16:32:54 2003 --- ./tlink.c Thu May 22 11:49:32 2003 *************** scan_linker_output (fname) *** 632,637 **** --- 632,643 ---- /* Then try "double quotes". */ else if (p = strchr (oldq, '"'), p) p++, q = strchr (p, '"'); + else { + /* Then try entire line. */ + q = strchr (oldq, 0); + if (q != oldq) + p = oldq; + } if (p) { --------------