diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2014-06-26 09:16:28 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2014-06-26 09:16:28 +0000 |
commit | 5f0ad6a5613a3b436dfd91ce7c3b969aeeaa55eb (patch) | |
tree | ca9b56a1959b3c1e842cc178449311307ce1841f /gcc/lto-wrapper.c | |
parent | 608508a67719de05d2144200325662bda7204adc (diff) | |
download | gcc-5f0ad6a5613a3b436dfd91ce7c3b969aeeaa55eb.zip gcc-5f0ad6a5613a3b436dfd91ce7c3b969aeeaa55eb.tar.gz gcc-5f0ad6a5613a3b436dfd91ce7c3b969aeeaa55eb.tar.bz2 |
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.
From-SVN: r212020
Diffstat (limited to 'gcc/lto-wrapper.c')
-rw-r--r-- | gcc/lto-wrapper.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 49f0895..08fd090 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -70,7 +70,7 @@ const char tool_name[] = "lto-wrapper"; /* Delete tempfiles. Called from utils_cleanup. */ void -tool_cleanup (void) +tool_cleanup (bool) { unsigned int i; @@ -91,7 +91,7 @@ tool_cleanup (void) static void lto_wrapper_cleanup (void) { - utils_cleanup (); + utils_cleanup (false); } /* Unlink a temporary LTRANS file unless requested otherwise. */ @@ -684,7 +684,7 @@ run_gcc (unsigned argc, char *argv[]) new_argv = XOBFINISH (&argv_obstack, const char **); argv_ptr = &new_argv[new_head_argc]; - fork_execute (CONST_CAST (char **, new_argv)); + fork_execute (new_argv[0], CONST_CAST (char **, new_argv), true); if (lto_mode == LTO_MODE_LTO) { @@ -792,7 +792,8 @@ cont: } else { - fork_execute (CONST_CAST (char **, new_argv)); + fork_execute (new_argv[0], CONST_CAST (char **, new_argv), + true); maybe_unlink (input_name); } @@ -828,8 +829,9 @@ cont: } new_argv[i++] = "all"; new_argv[i++] = NULL; - pex = collect_execute (CONST_CAST (char **, new_argv)); - collect_wait (new_argv[0], pex); + pex = collect_execute (new_argv[0], CONST_CAST (char **, new_argv), + NULL, NULL, PEX_SEARCH, false); + do_wait (new_argv[0], pex); maybe_unlink (makefile); makefile = NULL; for (i = 0; i < nr; ++i) |