[lto][patch] Split archives

Diego Novillo dnovillo@google.com
Thu Sep 11 14:51:00 GMT 2008


On Thu, Sep 11, 2008 at 04:28, Rafael Espindola <espindola@google.com> wrote:

> This is less efficient than adding support for archives in lto1, but easier.

Agreed.  Could you put .a support in lto1 in the TODO list on the wiki?

> +#define temp_obj_dir_name "tmp_objects"

What about mkdtemp()?

> +/* Remove temporary files at the end of the link. */
> +
> +static enum ld_plugin_status
> +cleanup_handler (void)
> +{
> +  int t = system ("rm -rf " temp_obj_dir_name);

Ouch, this looks dangerous.  I would rather have a more
controlled cleanup via remove().

> +      objnum++;
> +
> +      fd = open(objname, O_RDWR | O_CREAT, 0666);

space before '('.

>      }
> +
> +  t = mkdir (temp_obj_dir_name, 0777);

s/0777/0700/


Looks OK otherwise.


Diego.



More information about the Gcc-patches mailing list