Print warning diagnostics for -flto issues.
gcc/ChangeLog: * lto-wrapper.c (print_lto_docs_link): New function. (run_gcc): Print warning about missing job server detection after we know NR of partitions. Do the same for -flto{,=1}. * opts.c (get_option_html_page): Support -flto option.
This commit is contained in:
parent
227a2ecf66
commit
7d7d925d0d
2 changed files with 42 additions and 3 deletions
|
@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "simple-object.h"
|
||||
#include "lto-section-names.h"
|
||||
#include "collect-utils.h"
|
||||
#include "opts-diagnostic.h"
|
||||
|
||||
/* Environment variable, used for passing the names of offload targets from GCC
|
||||
driver to lto-wrapper. */
|
||||
|
@ -1322,6 +1323,23 @@ jobserver_active_p (void)
|
|||
return JS_PREFIX "cannot access %<" JS_NEEDLE "%> file descriptors";
|
||||
}
|
||||
|
||||
/* Print link to -flto documentation with a hint message. */
|
||||
|
||||
void
|
||||
print_lto_docs_link ()
|
||||
{
|
||||
const char *url = get_option_url (NULL, OPT_flto);
|
||||
|
||||
pretty_printer pp;
|
||||
pp.url_format = URL_FORMAT_DEFAULT;
|
||||
pp_string (&pp, "see the ");
|
||||
pp_begin_url (&pp, url);
|
||||
pp_string (&pp, "%<-flto%> option documentation");
|
||||
pp_end_url (&pp);
|
||||
pp_string (&pp, " for more information");
|
||||
inform (UNKNOWN_LOCATION, pp_formatted_text (&pp));
|
||||
}
|
||||
|
||||
/* Test that a make command is present and working, return true if so. */
|
||||
|
||||
static bool
|
||||
|
@ -1356,8 +1374,10 @@ run_gcc (unsigned argc, char *argv[])
|
|||
char *collect_gcc_options;
|
||||
int parallel = 0;
|
||||
int jobserver = 0;
|
||||
bool jobserver_requested = false;
|
||||
int auto_parallel = 0;
|
||||
bool no_partition = false;
|
||||
const char *jobserver_error = NULL;
|
||||
vec<cl_decoded_option> fdecoded_options;
|
||||
fdecoded_options.create (16);
|
||||
vec<cl_decoded_option> offload_fdecoded_options = vNULL;
|
||||
|
@ -1502,6 +1522,7 @@ run_gcc (unsigned argc, char *argv[])
|
|||
{
|
||||
parallel = 1;
|
||||
jobserver = 1;
|
||||
jobserver_requested = true;
|
||||
}
|
||||
else if (strcmp (option->arg, "auto") == 0)
|
||||
{
|
||||
|
@ -1556,15 +1577,15 @@ run_gcc (unsigned argc, char *argv[])
|
|||
{
|
||||
lto_mode = LTO_MODE_LTO;
|
||||
jobserver = 0;
|
||||
jobserver_requested = false;
|
||||
auto_parallel = 0;
|
||||
parallel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *jobserver_error = jobserver_active_p ();
|
||||
jobserver_error = jobserver_active_p ();
|
||||
if (jobserver && jobserver_error != NULL)
|
||||
{
|
||||
warning (0, jobserver_error);
|
||||
/* Fall back to auto parallelism. */
|
||||
jobserver = 0;
|
||||
auto_parallel = 1;
|
||||
|
@ -1879,6 +1900,20 @@ cont:
|
|||
maybe_unlink (ltrans_output_file);
|
||||
ltrans_output_file = NULL;
|
||||
|
||||
if (nr > 1)
|
||||
{
|
||||
if (jobserver_requested && jobserver_error != NULL)
|
||||
{
|
||||
warning (0, jobserver_error);
|
||||
print_lto_docs_link ();
|
||||
}
|
||||
else if (parallel == 0)
|
||||
{
|
||||
warning (0, "using serial compilation of %d LTRANS jobs", nr);
|
||||
print_lto_docs_link ();
|
||||
}
|
||||
}
|
||||
|
||||
if (parallel)
|
||||
{
|
||||
makefile = make_temp_file (".mk");
|
||||
|
|
|
@ -3243,9 +3243,13 @@ get_option_html_page (int option_index)
|
|||
const cl_option *cl_opt = &cl_options[option_index];
|
||||
|
||||
/* Analyzer options are on their own page. */
|
||||
if (strstr(cl_opt->opt_text, "analyzer-"))
|
||||
if (strstr (cl_opt->opt_text, "analyzer-"))
|
||||
return "gcc/Static-Analyzer-Options.html";
|
||||
|
||||
/* Handle -flto= option. */
|
||||
if (strstr (cl_opt->opt_text, "flto"))
|
||||
return "gcc/Optimize-Options.html";
|
||||
|
||||
#ifdef CL_Fortran
|
||||
if ((cl_opt->flags & CL_Fortran) != 0
|
||||
/* If it is option common to both C/C++ and Fortran, it is documented
|
||||
|
|
Loading…
Add table
Reference in a new issue