This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto][patch] Add a wrapper to share code among collect2 and the linker plugin
- From: Diego Novillo <dnovillo at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Nov 2008 12:57:07 -0500
- Subject: Re: [lto][patch] Add a wrapper to share code among collect2 and the linker plugin
- References: <38a0d8450811280756x4d71db62sc0c2b49da6bd0077@mail.gmail.com>
On Fri, Nov 28, 2008 at 10:56, Rafael Espindola <espindola@google.com> wrote:
> It produces some noise in the failing test cases since now collect2
> reports on the lto-wrapper failure.
Noise? New failures or different messages confusing dejagnu?
> - char *ltrans_output_file = NULL;
> + char *lto_wrapper = getenv ("COLLECT_LTO_WRAPPER");
> + struct pex_obj *pex;
> + const char *prog = "lto-wrapper";
> +
> + if (!lto_wrapper)
> + fatal ("lto wrapper not found");
Better use the more explicit message: "COLLECT_LTO_WRAPPER not
set".
> --- /dev/null
> +++ b/gcc/lto-wrapper.c
> @@ -0,0 +1,269 @@
Copyright headers missing.
This is a good place to put an overall description of how the
whole thing works and the purpose of lto-wrapper. Entry point,
how it's called, what it does, etc.
> +static enum lto_mode_d lto_mode = LTO_MODE_NONE; /* current LTO mode. */
> +
> +/* Just die. */
> +
Might as well put properly documented arguments now. Likewise
all the other functions copied from collect2.
> +static void
> +fork_execute (char **argv)
Needs documenting comment.
> +{
> + struct pex_obj *pex;
> +
> + pex = collect_execute (argv);
> + collect_wait (argv[0], pex);
> +}
> +
> +static void
> +run_gcc(unsigned argc, char *argv[])
Likewise.
> +static int
> +process_args (int argc, char *argv[], char *gcc_argv[])
Likewise.
OK with those changes.
Diego.