* 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
45 lines
1.5 KiB
C
45 lines
1.5 KiB
C
/* Utility functions used by tools like collect2 and lto-wrapper.
|
|
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 3, or (at your option) any later
|
|
version.
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GCC; see the file COPYING3. If not see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
/* Provided in collect-utils.c. */
|
|
extern void notice (const char *, ...)
|
|
__attribute__ ((format (printf, 1, 2)));
|
|
extern void fatal_signal (int);
|
|
|
|
extern struct pex_obj *collect_execute (const char *, char **,
|
|
const char *, const char *,
|
|
int, bool);
|
|
extern int collect_wait (const char *, struct pex_obj *);
|
|
extern void do_wait (const char *, struct pex_obj *);
|
|
extern void fork_execute (const char *, char **, bool);
|
|
extern void utils_cleanup (bool);
|
|
|
|
|
|
extern bool debug;
|
|
extern bool verbose;
|
|
extern bool save_temps;
|
|
|
|
/* Provided by the tool itself. */
|
|
|
|
/* The name of the tool, printed in error messages. */
|
|
extern const char tool_name[];
|
|
/* Called by utils_cleanup. */
|
|
extern void tool_cleanup (bool);
|
|
extern void maybe_unlink (const char *);
|