musl_config.gni 2.2 KB
Newer Older
Z
zhuoli 已提交
1 2 3 4 5 6
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/sanitizers/sanitizers.gni")

declare_args() {
7
  if (current_cpu == "arm") {
Z
zhuoli 已提交
8
    musl_arch = "arm"
9
  } else if (current_cpu == "arm64") {
Z
zhuoli 已提交
10
    musl_arch = "aarch64"
H
honglie 已提交
11
  } else if (current_cpu == "x86_64" || current_cpu == "x64") {
W
wangjiahui 已提交
12
    musl_arch = "x86_64"
X
xiangren.yuan 已提交
13 14
  } else if (current_cpu == "mipsel") {
    musl_arch = "mipsel"
Z
zhuoli 已提交
15 16 17 18 19 20 21 22 23 24 25
  }
  # musl_root = "$root_out_dir/obj/third_party/musl"
  # musl_sub_arch = ""
  # musl_syslib_dir = "/system/bin"
  # musl_linker_extension = "so.1"
}

declare_args() {
  if ((defined(target_os) && target_os == "ohos") ||
      (defined(ohos_kernel_type) && ohos_kernel_type == "linux")) {
    musl_target_os = "linux"
M
maweiye 已提交
26
    musl_target_triple = "${musl_arch}-linux-ohos"
Z
zhuoli 已提交
27 28
  } else if (defined(ohos_kernel_type) && ohos_kernel_type == "liteos_a") {
    musl_target_os = "liteos_a"
M
maweiye 已提交
29
    musl_target_triple = "arm-liteos-ohos"
Z
zhuoli 已提交
30 31 32 33
  }
}

declare_args() {
D
dhy308 已提交
34
  runtime_lib_path =
C
chenhao 已提交
35
      "//prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/12.0.1/lib"
Z
zhuoli 已提交
36
  user_custom_libc = true
C
ChenJie 已提交
37
  use_jemalloc = false
C
ChenJie 已提交
38
  use_jemalloc_dfx_intf = false
D
dhy308 已提交
39
  musl_ported_dir = "intermidiates/${musl_target_os}/musl_src_ported"
Z
zhuoli 已提交
40
  musl_inc_out_dir = "usr/include/${musl_target_triple}"
41
  uapi_dir = "//kernel/linux/patches/linux-5.10/prebuilts/usr/include"
42
  linux_kernel_dir = "//kernel/linux/linux-5.10"
J
jwchendi 已提交
43 44
  musl_dir = "//third_party/musl"
  musl_porting_dir = "//third_party/musl/porting/linux/user"
Z
zhuoli 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57

  # if (is_asan) {
  #   musl_linker_asan_name =
  #       musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}-asan"
  #   musl_ldso_path =
  #       musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}-asan." +
  #       musl_linker_extension
  # } else {
  #   musl_ldso_path =
  #       musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}." +
  #       musl_linker_extension
  # }
}
G
ganlan 已提交
58 59

declare_args() {
60 61 62
  if (!is_standard_system) {
    enable_musl_log = false
  }
63
  musl_iterate_and_stats_api = true
F
Far 已提交
64
  musl_secure_level = 1
G
ganlan 已提交
65
}
G
ganlan 已提交
66 67 68 69 70 71

declare_args() {
  if (!defined(product_path)) {
    product_path = ""
  }
}
D
dhy308 已提交
72 73 74 75 76

declare_args() {
  # for unit test
  musl_unit_test_flag = false
}