mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Backed out changeset 3dcccc40be04 (bug 1839832) for causing shippable build bustage.CLOSED TREE
This commit is contained in:
parent
fa52b30e86
commit
241cba7e1f
@ -10,14 +10,6 @@ llvm_profdata = check_prog(
|
||||
"LLVM_PROFDATA", ["llvm-profdata"], allow_missing=True, paths=clang_search_path
|
||||
)
|
||||
|
||||
|
||||
@depends_if(llvm_profdata)
|
||||
@checking("whether llvm-profdata supports 'order' subcommand")
|
||||
def llvm_profdata_order(profdata):
|
||||
retcode, _, _ = get_cmd_output(profdata, "order", "--help")
|
||||
return retcode == 0
|
||||
|
||||
|
||||
option(
|
||||
"--enable-profile-generate",
|
||||
env="MOZ_PROFILE_GENERATE",
|
||||
@ -50,8 +42,7 @@ option(
|
||||
|
||||
option(
|
||||
"--with-pgo-profile-path",
|
||||
help="Path to the directory with unmerged profile data to use during the build"
|
||||
", or to a merged profdata file",
|
||||
help="Path to the directory with unmerged profile data to use during the build",
|
||||
nargs=1,
|
||||
)
|
||||
|
||||
@ -88,27 +79,6 @@ def pgo_profile_path(path, pgo_use, profdata, build_env):
|
||||
set_config("PGO_PROFILE_PATH", pgo_profile_path)
|
||||
|
||||
|
||||
@depends(
|
||||
"--enable-profile-use",
|
||||
pgo_profile_path,
|
||||
llvm_profdata,
|
||||
llvm_profdata_order,
|
||||
build_environment,
|
||||
)
|
||||
def orderfile_path(profile_use, path, profdata, profdata_order, build_env):
|
||||
if not profile_use:
|
||||
return None
|
||||
|
||||
if not profdata_order:
|
||||
return None
|
||||
|
||||
topobjdir = build_env.topobjdir
|
||||
|
||||
orderfile = os.path.join(topobjdir, "orderfile.txt")
|
||||
check_cmd_output(profdata, "order", path, "-o", orderfile)
|
||||
return orderfile
|
||||
|
||||
|
||||
pgo_temporal = c_compiler.try_compile(
|
||||
flags=["-fprofile-generate", "-mllvm", "-pgo-temporal-instrumentation"],
|
||||
check_msg="whether the C compiler supports temporal instrumentation",
|
||||
@ -116,16 +86,9 @@ pgo_temporal = c_compiler.try_compile(
|
||||
)
|
||||
|
||||
|
||||
@depends(
|
||||
c_compiler,
|
||||
select_linker,
|
||||
pgo_profile_path,
|
||||
orderfile_path,
|
||||
target_is_windows,
|
||||
pgo_temporal,
|
||||
)
|
||||
@depends(c_compiler, pgo_profile_path, target_is_windows, pgo_temporal)
|
||||
@imports("multiprocessing")
|
||||
def pgo_flags(compiler, linker, profdata, orderfile, target_is_windows, pgo_temporal):
|
||||
def pgo_flags(compiler, profdata, target_is_windows, pgo_temporal):
|
||||
if compiler.type == "gcc":
|
||||
return namespace(
|
||||
gen_cflags=["-fprofile-generate"],
|
||||
@ -142,16 +105,6 @@ def pgo_flags(compiler, linker, profdata, orderfile, target_is_windows, pgo_temp
|
||||
else:
|
||||
gen_ldflags = ["-fprofile-generate"]
|
||||
|
||||
use_ldflags = []
|
||||
if orderfile:
|
||||
if compiler.type == "clang-cl":
|
||||
use_ldflags += ["-ORDERFILE:@" + orderfile]
|
||||
elif linker.KIND == "lld":
|
||||
use_ldflags += ["-Wl,--symbol-ordering-file", orderfile]
|
||||
|
||||
if use_ldflags:
|
||||
log.info("Activating PGO-based orderfile")
|
||||
|
||||
gen_cflags = [prefix + "-fprofile-generate"]
|
||||
if pgo_temporal:
|
||||
gen_cflags += ["-mllvm", "-pgo-temporal-instrumentation"]
|
||||
@ -171,7 +124,7 @@ def pgo_flags(compiler, linker, profdata, orderfile, target_is_windows, pgo_temp
|
||||
# come in via -Wbackend-plugin, so disable those too.
|
||||
"-Wno-error=backend-plugin",
|
||||
],
|
||||
use_ldflags=use_ldflags,
|
||||
use_ldflags=[],
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user