From f95ee272af63875aed197f3c81d75a4383f83222 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 24 Jul 2020 13:05:51 +0000 Subject: [PATCH] Bug 1644409 - Make --enable-lto=thin work with GCC. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D84773 --- build/moz.configure/lto-pgo.configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure index 5552282f1316..fd8e3bf90a55 100644 --- a/build/moz.configure/lto-pgo.configure +++ b/build/moz.configure/lto-pgo.configure @@ -229,7 +229,10 @@ def lto(value, c_compiler, ld64_known_good, target, instrumented_build): # instruction sets. else: num_cores = multiprocessing.cpu_count() - cflags.append("-flto") + if len(value) and value[0].lower() == 'full': + cflags.append("-flto") + else: + cflags.append("-flto=thin") cflags.append("-flifetime-dse=1") ldflags.append("-flto=%s" % num_cores)