This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libiberty] Use pipe inside pex_run


On Mon, Oct 1, 2018 at 10:53 AM, Nathan Sidwell <nathan@acm.org> wrote:
> Ian,
> this patch implements the pipe error channel you suggested a while back.
> Before the (v)fork we create a pipe and set it up for CLOEXEC.  If exec
> failure happens in the child, we write errno & the fnname to the pipe.  In
> the parent we attempt to read the pipe.  We'll get EOF if the child was
> successful.  Otherwise we get the error and fn, which we pass back to our
> caller.  As both child and parent are in the same address space, it's
> perfectly fine to pass string literal addresses down the pipe.
>
> An example of the difference is the behaviour of:
>  ./xg++ -Bbogus ...
>
> before the patch we get:
> xg++: error trying to exec 'cc1plus': execvp: No such file or directory
>
> with the patch we get:
> xg++: fatal error: cannot execute ‘cc1plus’: execvp: No such file or
> directory
> compilation terminated.
>
> Martin has been kind enough to test this patch in his profiled-bootstrap
> build, and I've tested on AIX (where vfork is fork) as well asx86_64-linux.

Thanks for doing this.

This is OK.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]