diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-26 09:16:28 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-26 09:16:28 +0000 |
commit | 39ef03bb3a7080964e11703941c2bdee83f4f433 (patch) | |
tree | ca9b56a1959b3c1e842cc178449311307ce1841f /gcc/tlink.c | |
parent | 572cae003b64c085a501636f9ffab6cfb7c31b62 (diff) | |
download | gcc-39ef03bb3a7080964e11703941c2bdee83f4f433.tar.gz |
Part 2 of the collect-utils library, now also used for collect2.
* Makefile.in (COLLECT2_OBJS): Add collect-utils.o.
(LTO_WRAPPER_OBJS): New variable.
(lto-wrapper$(exeext)): Use it.
* collect2.c: Include "collect-utils.h".
(verbose, debug): Remove variables.
(at_file_supplied): No longer static.
(tool_name): New variable.
(do_wait, fork_execute, maybe_unlink): Don't declare.
(tool_cleanup): No longer static.
(notice): Remove function.
(maybe_run_lto_and_relink, main, do_dsymutil): Add new arg to
fork_execute calls.
(collect_wait, do_wait, collect_execute): Remove functions.
(maybe_unlink): No longer static.
* collect2.h (verbose, debug): Don't declare.
(at_file_supplied): Declare.
* collect-utils.c (utils_cleanup): New arg from_signal. All callers
changed.
(collect_execute): Replace with implementation from collect2, plus a
new arg use_atfile. All callers changed.
(collect_wait): Replace with implementation from collect2.
(maybe_unlink_file): Remove function.
(fork_execute): Replace with implementation from collect2, plus a
new arg use_atfile. All callers changed.
(do_wait): Add call to utils_cleanup to the error path.
* collect-utils.h (collect_execute, fork_execute, utils_cleanup,
tool_cleanup): Adjust declarations.
* lto-wrapper.c (tool_cleanup): Add unused bool argument.
* tlink.c: Include "collect-utils.h".
(tlink_execute): New arg use_atfile. All callers changed.
(tlink_init, tlink_execute): Remove declarations.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212020 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tlink.c')
-rw-r--r-- | gcc/tlink.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tlink.c b/gcc/tlink.c index addea61fdb4..89777ff7781 100644 --- a/gcc/tlink.c +++ b/gcc/tlink.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "hashtab.h" #include "demangle.h" #include "collect2.h" +#include "collect-utils.h" #include "filenames.h" #include "diagnostic-core.h" #include "vec.h" @@ -104,8 +105,6 @@ static void symbol_push (symbol *); static symbol * symbol_pop (void); static void file_push (file *); static file * file_pop (void); -static void tlink_init (void); -static int tlink_execute (const char *, char **, const char *, const char *); static char * frob_extension (const char *, const char *); static char * obstack_fgets (FILE *, struct obstack *); static char * tfgets (FILE *); @@ -286,11 +285,12 @@ tlink_init (void) static int tlink_execute (const char *prog, char **argv, const char *outname, - const char *errname) + const char *errname, bool use_atfile) { struct pex_obj *pex; - pex = collect_execute (prog, argv, outname, errname, PEX_LAST | PEX_SEARCH); + pex = collect_execute (prog, argv, outname, errname, + PEX_LAST | PEX_SEARCH, use_atfile); return collect_wait (prog, pex); } @@ -545,7 +545,7 @@ recompile_files (void) fprintf (stderr, _("collect: recompiling %s\n"), f->main); if (chdir (f->dir) != 0 - || tlink_execute (c_file_name, argv, NULL, NULL) != 0 + || tlink_execute (c_file_name, argv, NULL, NULL, false) != 0 || chdir (initial_cwd) != 0) return 0; @@ -817,7 +817,8 @@ scan_linker_output (const char *fname) void do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED) { - int ret = tlink_execute ("ld", ld_argv, ldout, lderrout); + int ret = tlink_execute ("ld", ld_argv, ldout, lderrout, + HAVE_GNU_LD && at_file_supplied); tlink_init (); @@ -843,7 +844,8 @@ do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED) break; if (tlink_verbose) fprintf (stderr, _("collect: relinking\n")); - ret = tlink_execute ("ld", ld_argv, ldout, lderrout); + ret = tlink_execute ("ld", ld_argv, ldout, lderrout, + HAVE_GNU_LD && at_file_supplied); } } |