#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include <signal.h>
-#if ! defined( SIGCHLD ) && defined( SIGCLD )
-# define SIGCHLD SIGCLD
-#endif
/* TARGET_64BIT may be defined to use driver specific functionality. */
#undef TARGET_64BIT
prefix_from_env (const char *env, struct path_prefix *pprefix)
{
const char *p;
- GET_ENVIRONMENT (p, env);
+ p = getenv (env);
if (p)
prefix_from_string (p, pprefix);
size_t num_files;
if (!lto_wrapper)
- fatal ("COLLECT_LTO_WRAPPER must be set.");
+ fatal ("COLLECT_LTO_WRAPPER must be set");
num_lto_c_args++;
int num_c_args;
char **old_argv;
- bool use_verbose = false;
-
old_argv = argv;
expandargv (&argc, &argv);
if (argv != old_argv)
/* Parse command line early for instances of -debug. This allows
the debug flag to be set before functions like find_a_file()
- are called. We also look for the -flto or -fwhopr flag to know
+ are called. We also look for the -flto or -flto-partition=none flag to know
what LTO mode we are in. */
{
int i;
+ bool no_partition = false;
for (i = 1; argv[i] != NULL; i ++)
{
if (! strcmp (argv[i], "-debug"))
debug = true;
- else if (! strcmp (argv[i], "-flto") && ! use_plugin)
- {
- use_verbose = true;
- lto_mode = LTO_MODE_LTO;
- }
- else if (! strncmp (argv[i], "-fwhopr", 7) && ! use_plugin)
- {
- use_verbose = true;
- lto_mode = LTO_MODE_WHOPR;
- }
+ else if (! strcmp (argv[i], "-flto-partition=none"))
+ no_partition = true;
+ else if ((! strncmp (argv[i], "-flto=", 6)
+ || ! strcmp (argv[i], "-flto")) && ! use_plugin)
+ lto_mode = LTO_MODE_WHOPR;
else if (! strcmp (argv[i], "-plugin"))
{
use_plugin = true;
- use_verbose = true;
lto_mode = LTO_MODE_NONE;
}
#ifdef COLLECT_EXPORT_LIST
#endif
}
vflag = debug;
+ if (no_partition)
+ lto_mode = LTO_MODE_LTO;
}
#ifndef DEFAULT_A_OUT_NAME
*c_ptr++ = xstrdup (q);
}
}
- if (use_verbose && *q == '-' && q[1] == 'v' && q[2] == 0)
- {
- /* Turn on trace in collect2 if needed. */
- vflag = true;
- }
}
obstack_free (&temporary_obstack, temporary_firstobj);
*c_ptr++ = "-fno-profile-arcs";
break;
case 'f':
- if (strcmp (arg, "-flto") == 0
- || strncmp (arg, "-fwhopr", 7) == 0)
+ if (strncmp (arg, "-flto", 5) == 0)
{
#ifdef ENABLE_LTO
/* Do not pass LTO flag to the linker. */
if (helpflag)
{
- fprintf (stderr, "Usage: collect2 [options]\n");
- fprintf (stderr, " Wrap linker and generate constructor code if needed.\n");
- fprintf (stderr, " Options:\n");
- fprintf (stderr, " -debug Enable debug output\n");
- fprintf (stderr, " --help Display this information\n");
- fprintf (stderr, " -v, --version Display this program's version number\n");
- fprintf (stderr, "Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html\n");
- fprintf (stderr, "Report bugs: %s\n", bug_report_url);
-
- collect_exit (0);
+ printf ("Usage: collect2 [options]\n");
+ printf (" Wrap linker and generate constructor code if needed.\n");
+ printf (" Options:\n");
+ printf (" -debug Enable debug output\n");
+ printf (" --help Display this information\n");
+ printf (" -v, --version Display this program's version number\n");
+ printf ("\n");
+ printf ("Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html\n");
+ printf ("Report bugs: %s\n", bug_report_url);
+ printf ("\n");
}
if (debug)