• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 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.
4import("//build/config/sanitizers/sanitizers.gni")
5
6declare_args() {
7  if (current_cpu == "arm") {
8    musl_arch = "arm"
9  } else if (current_cpu == "arm64") {
10    musl_arch = "aarch64"
11  } else if (current_cpu == "x86_64" || current_cpu == "x64") {
12    musl_arch = "x86_64"
13  } else if (current_cpu == "mipsel") {
14    musl_arch = "mipsel"
15  }
16  # musl_root = "$root_out_dir/obj/third_party/musl"
17  # musl_sub_arch = ""
18  # musl_syslib_dir = "/system/bin"
19  # musl_linker_extension = "so.1"
20}
21
22declare_args() {
23  if ((defined(target_os) && target_os == "ohos") ||
24      (defined(ohos_kernel_type) && ohos_kernel_type == "linux")) {
25    musl_target_os = "linux"
26    musl_target_triple = "${musl_arch}-linux-ohos"
27  } else if (defined(ohos_kernel_type) && ohos_kernel_type == "liteos_a") {
28    musl_target_os = "liteos_a"
29    musl_target_triple = "arm-liteos-ohos"
30  }
31}
32
33declare_args() {
34  runtime_lib_path =
35      "//prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/12.0.1/lib"
36  user_custom_libc = true
37  use_jemalloc = false
38  musl_malloc_plugin = ""
39  use_jemalloc_dfx_intf = false
40  use_jemalloc_recycle_func = false
41  use_pthread_cancel = false
42  musl_ported_dir = "intermidiates/${musl_target_os}/musl_src_ported"
43  musl_inc_out_dir = "usr/include/${musl_target_triple}"
44  uapi_dir = "//kernel/linux/patches/linux-5.10/prebuilts/usr/include"
45  linux_kernel_dir = "//kernel/linux/linux-5.10"
46  musl_dir = "//third_party/musl"
47  musl_porting_dir = "//third_party/musl/porting/linux/user"
48
49  # if (is_asan) {
50  #   musl_linker_asan_name =
51  #       musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}-asan"
52  #   musl_ldso_path =
53  #       musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}-asan." +
54  #       musl_linker_extension
55  # } else {
56  #   musl_ldso_path =
57  #       musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}." +
58  #       musl_linker_extension
59  # }
60}
61
62declare_args() {
63  if (!is_standard_system) {
64    enable_musl_log = false
65  }
66  musl_iterate_and_stats_api = false
67  musl_secure_level = 1
68}
69
70declare_args() {
71  if (!defined(product_path)) {
72    product_path = ""
73  }
74}
75
76declare_args() {
77  # for unit test
78  musl_unit_test_flag = false
79}
80