Bug 1947559 - Setup bolt-improved build for taskcluster clang r=glandium
The version produced on taskcluster with bolt on compiles the sqlite amalgamation 6% faster, which is promising for firefox itself. Differential Revision: https://phabricator.services.mozilla.com/D237861
This commit is contained in:
committed by
sguelton@mozilla.com
parent
bccb0ba50c
commit
cfa3561502
@@ -210,6 +210,7 @@ def build_one_stage(
|
||||
targets,
|
||||
is_final_stage=False,
|
||||
profile=None,
|
||||
bolt=False,
|
||||
):
|
||||
if not os.path.exists(stage_dir):
|
||||
os.mkdir(stage_dir)
|
||||
@@ -229,6 +230,10 @@ def build_one_stage(
|
||||
else:
|
||||
machine_targets = "X86"
|
||||
|
||||
# see llvm-project/clang/cmake/caches/BOLT.cmake
|
||||
if bolt:
|
||||
ldflags.append("-Wl,--emit-relocs,-znow")
|
||||
|
||||
cmake_args = [
|
||||
"-GNinja",
|
||||
"-DCMAKE_C_COMPILER=%s" % slashify_path(cc[0]),
|
||||
@@ -274,6 +279,11 @@ def build_one_stage(
|
||||
else:
|
||||
cmake_args.append("-DLLVM_TOOL_LLI_BUILD=OFF")
|
||||
|
||||
if bolt:
|
||||
projects.append("bolt")
|
||||
cmake_args.append("-DCLANG_BOLT=INSTRUMENT")
|
||||
cmake_args.append("-DCLANG_INCLUDE_TESTS=ON")
|
||||
|
||||
cmake_args.append("-DLLVM_ENABLE_PROJECTS=%s" % ";".join(projects))
|
||||
|
||||
if is_final_stage:
|
||||
@@ -594,6 +604,9 @@ def main():
|
||||
pgo = config["pgo"]
|
||||
if pgo not in (True, False):
|
||||
raise ValueError("Only boolean values are accepted for pgo.")
|
||||
bolt = config.get("bolt", False)
|
||||
if bolt not in (True, False):
|
||||
raise ValueError("Only boolean values are accepted for bolt.")
|
||||
build_type = "Release"
|
||||
if "build_type" in config:
|
||||
build_type = config["build_type"]
|
||||
@@ -883,6 +896,7 @@ def main():
|
||||
targets,
|
||||
is_final_stage=(stages == 4),
|
||||
profile=profile,
|
||||
bolt=bolt,
|
||||
)
|
||||
|
||||
if build_clang_tidy:
|
||||
|
||||
Reference in New Issue
Block a user