From 119295372f3717e78edd43a8ae1a2003d0fcc0e6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 26 Oct 2020 18:56:52 +0100 Subject: [PATCH] lto: no sub-make when --jobserver-auth= is missing We newly correctly detect that a job server is not active for a LTO linking: lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS' In that situation we should not call make -f abc.mk as it can leed to N^2 LTRANS units. gcc/ChangeLog: * lto-wrapper.c (run_gcc): Do not use sub-make when jobserver is not detected properly. --- gcc/lto-wrapper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index b2af3caa021..fe10f4f4fbb 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1582,7 +1582,11 @@ run_gcc (unsigned argc, char *argv[]) { const char *jobserver_error = jobserver_active_p (); if (jobserver && jobserver_error != NULL) - warning (0, jobserver_error); + { + warning (0, jobserver_error); + parallel = 0; + jobserver = 0; + } else if (!jobserver && jobserver_error == NULL) { parallel = 1; -- 2.30.2