1# Copyright 2019 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/chromeos/rules.gni")
6
7assert(is_chromeos)
8
9declare_args() {
10  # The location to a file used to dump symbols ordered by Call-Chain Clustering (C3)
11  # https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.pdf?
12  # to a file, used for generating orderfiles in Chrome OS
13  dump_call_chain_clustering_order = ""
14}
15
16declare_args() {
17  # Whether or not we're using new pass manager to build and link Chrome
18  use_new_pass_manager = dump_call_chain_clustering_order != ""
19}
20
21config("print_orderfile") {
22  if (dump_call_chain_clustering_order != "") {
23    _output_orderfile =
24        rebase_path(dump_call_chain_clustering_order, root_build_dir)
25    ldflags = [ "-Wl,--print-symbol-order=$_output_orderfile" ]
26  }
27}
28
29config("compiler") {
30  if (use_new_pass_manager) {
31    cflags = [ "-fexperimental-new-pass-manager" ]
32    ldflags = [ "-fexperimental-new-pass-manager" ]
33  }
34}
35