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: Create a library for tools like collect2 and lto-wrapper (2/2)


On Thu, 22 May 2014, Bernd Schmidt wrote:

> The implementations of some functions like fork_execute are changed to those
> from collect2 and the calls in lto-wrapper adapted accordingly. There are some
> minor changes in these functions: for example I avoid calling fatal_error,
> instead using the fatal/fatal_perror functions so that the cleanup routine is
> called properly (lto-wrapper does not use atexit as collect2 does).

Avoiding fatal_error seems like the wrong direction.  Using the common 
diagnostics code from diagnostic.c is preferred to using custom code.  
Thus, as an initial step I'd suggest instead converting lto-wrapper to use 
the common functionality where possible (fatal_error with %m replacing 
fatal_perror), making it use atexit in the process.  Don't move code using 
legacy fatal / fatal_perror functions to a common library.

-- 
Joseph S. Myers
joseph@codesourcery.com


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