From c8c65e0730796d01e04c22de958fe904bb80c447 Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 18 May 2010 15:11:01 +0000 Subject: 2010-05-18 Richard Guenther PR lto/44143 * lto-wrapper.c (verbose): New variable. Initialize from -v. (debug): Initialize from -save-temps. (collect_execute): Print command-line when verbose. (run_gcc): Always use COLLECT_GCC_OPTIONS. Use fork_execute for ltrans invocation. Produce -dumpbase flag again. (process_args): Remove. (main): Simplify. * collect2.c (maybe_run_lto_and_relink): Only pass object files to lto-wrapper. * gcc.c (LINK_COMMAND_SPEC): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159536 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/collect2.c | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'gcc/collect2.c') diff --git a/gcc/collect2.c b/gcc/collect2.c index 5322e10bee2..0669a4e55f1 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -940,10 +940,8 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, if (lto_objects.first) { - const char *opts; char **lto_c_argv; const char **lto_c_ptr; - const char *cp; const char **p, **q, **r; const char **lto_o_ptr; struct lto_object *list; @@ -954,52 +952,15 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, if (!lto_wrapper) fatal ("COLLECT_LTO_WRAPPER must be set."); + num_lto_c_args++; + /* There is at least one object file containing LTO info, so we need to run the LTO back end and relink. */ - /* Get compiler options passed down from the parent `gcc' command. - These must be passed to the LTO back end. */ - opts = getenv ("COLLECT_GCC_OPTIONS"); - - /* Increment the argument count by the number of inherited options. - Some arguments may be filtered out later. Again, an upper bound - suffices. */ - - cp = opts; - - while (cp && *cp) - { - extract_string (&cp); - num_lto_c_args++; - } - obstack_free (&temporary_obstack, temporary_firstobj); - - if (debug) - num_lto_c_args++; - - /* Increment the argument count by the number of initial - arguments added below. */ - num_lto_c_args += 9; - lto_c_argv = (char **) xcalloc (sizeof (char *), num_lto_c_args); lto_c_ptr = CONST_CAST2 (const char **, char **, lto_c_argv); *lto_c_ptr++ = lto_wrapper; - *lto_c_ptr++ = c_file_name; - - cp = opts; - - while (cp && *cp) - { - const char *s = extract_string (&cp); - - /* Pass the option or argument to the wrapper. */ - *lto_c_ptr++ = xstrdup (s); - } - obstack_free (&temporary_obstack, temporary_firstobj); - - if (debug) - *lto_c_ptr++ = xstrdup ("-debug"); /* Add LTO objects to the wrapper command line. */ for (list = lto_objects.first; list; list = list->next) -- cgit v1.2.1