tlink.c (e4b17023) tlink.c (95d28233)
1/* Scan linker error messages for missing template instantiations and provide
2 them.
3
4 Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008,
1/* Scan linker error messages for missing template instantiations and provide
2 them.
3
4 Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008,
5 2009, 2010, 2011 Free Software Foundation, Inc.
5 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
6 Contributed by Jason Merrill (jason@cygnus.com).
7
8This file is part of GCC.
9
10GCC is free software; you can redistribute it and/or modify it under
11the terms of the GNU General Public License as published by the Free
12Software Foundation; either version 3, or (at your option) any later
13version.

--- 801 unchanged lines hidden (view full) ---

815
816 LD_ARGV is an array of arguments for the linker.
817 OBJECT_LST is an array of object files that we may be able to recompile
818 to provide missing definitions. Currently ignored. */
819
820void
821do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
822{
6 Contributed by Jason Merrill (jason@cygnus.com).
7
8This file is part of GCC.
9
10GCC is free software; you can redistribute it and/or modify it under
11the terms of the GNU General Public License as published by the Free
12Software Foundation; either version 3, or (at your option) any later
13version.

--- 801 unchanged lines hidden (view full) ---

815
816 LD_ARGV is an array of arguments for the linker.
817 OBJECT_LST is an array of object files that we may be able to recompile
818 to provide missing definitions. Currently ignored. */
819
820void
821do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
822{
823 int exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
823 int ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
824
825 tlink_init ();
826
824
825 tlink_init ();
826
827 if (exit)
827 if (ret)
828 {
829 int i = 0;
830
831 /* Until collect does a better job of figuring out which are object
832 files, assume that everything on the command line could be. */
833 if (read_repo_files (ld_argv))
828 {
829 int i = 0;
830
831 /* Until collect does a better job of figuring out which are object
832 files, assume that everything on the command line could be. */
833 if (read_repo_files (ld_argv))
834 while (exit && i++ < MAX_ITERATIONS)
834 while (ret && i++ < MAX_ITERATIONS)
835 {
836 if (tlink_verbose >= 3)
837 {
838 dump_file (ldout, stdout);
839 dump_file (lderrout, stderr);
840 }
841 demangle_new_symbols ();
842 if (! scan_linker_output (ldout)
843 && ! scan_linker_output (lderrout))
844 break;
845 if (! recompile_files ())
846 break;
847 if (tlink_verbose)
848 fprintf (stderr, _("collect: relinking\n"));
835 {
836 if (tlink_verbose >= 3)
837 {
838 dump_file (ldout, stdout);
839 dump_file (lderrout, stderr);
840 }
841 demangle_new_symbols ();
842 if (! scan_linker_output (ldout)
843 && ! scan_linker_output (lderrout))
844 break;
845 if (! recompile_files ())
846 break;
847 if (tlink_verbose)
848 fprintf (stderr, _("collect: relinking\n"));
849 exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
849 ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
850 }
851 }
852
853 dump_file (ldout, stdout);
854 unlink (ldout);
855 dump_file (lderrout, stderr);
856 unlink (lderrout);
850 }
851 }
852
853 dump_file (ldout, stdout);
854 unlink (ldout);
855 dump_file (lderrout, stderr);
856 unlink (lderrout);
857 if (exit)
857 if (ret)
858 {
858 {
859 error ("ld returned %d exit status", exit);
860 collect_exit (exit);
859 error ("ld returned %d exit status", ret);
860 exit (ret);
861 }
862}
861 }
862}