Commit c78bf562 authored by Connor Sheehan's avatar Connor Sheehan
Browse files

Bug 1684914: stop passing `-flto=thin` to gcc since it doesn't actually work...

Bug 1684914: stop passing `-flto=thin` to gcc since it doesn't actually work r=glandium,mhentges a=RyanVM

Passing `-flto=thin` worked previously but the value passed was just ignored
and full lto was performed. On newer versions of gcc passing an unknown value
causes failure. So this commit checks if `-flto=thin` is passed and fails with
an error message if so, else full lto is enabled if any other value is passed.

Differential Revision: https://phabricator.services.mozilla.com/D100953
parent 04787860
......@@ -277,10 +277,13 @@ def lto(
# instruction sets.
else:
num_cores = multiprocessing.cpu_count()
if len(value) and value[0].lower() == "full":
cflags.append("-flto")
if len(value) and value[0].lower() == "thin":
die(
"gcc does not support thin LTO. Use `--enable-lto` "
"to enable full LTO for gcc."
)
else:
cflags.append("-flto=thin")
cflags.append("-flto")
cflags.append("-flifetime-dse=1")
ldflags.append("-flto=%s" % num_cores)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment