GCC Middle and Back End API Reference
collect-utils.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "intl.h"
#include "diagnostic.h"
#include "obstack.h"
#include "opts.h"
#include "options.h"
#include "simple-object.h"
#include "lto-section-names.h"
#include "collect-utils.h"
Include dependency graph for collect-utils.cc:


void notice (const char *cmsgid,...)
void fatal_signal (int signum)
void setup_signals (void)
int collect_wait (const char *prog, struct pex_obj *pex)
void do_wait (const char *prog, struct pex_obj *pex)
struct pex_obj * collect_execute (const char *prog, char **argv, const char *outname, const char *errname, int flags, bool use_atfile, const char *atsuffix)
void fork_execute (const char *prog, char **argv, bool use_atfile, const char *atsuffix)
void utils_cleanup (bool from_signal)


static char * response_file
bool debug
bool verbose
bool save_temps
const char * dumppfx

Function Documentation

◆ collect_execute()

struct pex_obj * collect_execute ( const char * prog,
char ** argv,
const char * outname,
const char * errname,
int flags,
bool use_atfile,
const char * atsuffix )
Execute a program, and wait for the reply.   

References _, debug, dumppfx, errno, fatal_error(), fopen, free(), input_location, notice(), NULL, response_file, and verbose.

Referenced by do_link(), fork_execute(), maybe_run_lto_and_relink(), and run_gcc().

◆ collect_wait()

int collect_wait ( const char * prog,
struct pex_obj * pex )
Wait for a process to finish, and exit if a nonzero status is found.   

References fatal_error(), input_location, NULL, response_file, strsignal(), WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSIGNALED, and WTERMSIG.

Referenced by do_link(), and do_wait().

◆ do_wait()

void do_wait ( const char * prog,
struct pex_obj * pex )

◆ fatal_signal()

static void fatal_signal ( int signum)
On fatal signals, delete all the temporary files.   

References kill, and utils_cleanup().

Referenced by driver::global_initializations(), and setup_signals().

◆ fork_execute()

void fork_execute ( const char * prog,
char ** argv,
bool use_atfile,
const char * atsuffix )

◆ notice()

void notice ( const char * cmsgid,
... )
Notify user of a non-error.   

References _, ap, and vfprintf().

Referenced by collect_execute(), main(), maybe_unlink(), and write_c_file_stat().

◆ setup_signals()

void setup_signals ( void )
Setup the signal handlers for the utils.  

References fatal_signal().

Referenced by main(), and main().

◆ utils_cleanup()

void utils_cleanup ( bool from_signal)
Delete tempfiles.   

References tool_cleanup().

Referenced by fatal_signal(), and lto_wrapper_cleanup().

Variable Documentation

◆ debug

◆ dumppfx

◆ response_file

char* response_file
Utility functions used by tools like collect2 and lto-wrapper.
   Copyright (C) 2009-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see

Referenced by collect_execute(), and collect_wait().

◆ save_temps

◆ verbose