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 } 14 # musl_root = "$root_out_dir/obj/third_party/musl" 15 # musl_sub_arch = "" 16 # musl_syslib_dir = "/system/bin" 17 # musl_linker_extension = "so.1" 18} 19 20declare_args() { 21 if ((defined(target_os) && target_os == "ohos") || 22 (defined(ohos_kernel_type) && ohos_kernel_type == "linux")) { 23 musl_target_os = "linux" 24 musl_target_triple = "${musl_arch}-linux-ohos" 25 } else if (defined(ohos_kernel_type) && ohos_kernel_type == "liteos_a") { 26 musl_target_os = "liteos_a" 27 musl_target_triple = "arm-liteos-ohos" 28 } 29} 30 31declare_args() { 32 runtime_lib_path = 33 "//prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/12.0.1/lib" 34 user_custom_libc = true 35 use_jemalloc = false 36 use_jemalloc_dfx_intf = false 37 musl_ported_dir = "intermidiates/${musl_target_os}/musl_src_ported" 38 musl_inc_out_dir = "usr/include/${musl_target_triple}" 39 uapi_dir = "//kernel/linux/patches/linux-5.10/prebuilts/usr/include" 40 linux_kernel_dir = "//kernel/linux/linux-5.10" 41 musl_dir = "//third_party/musl" 42 musl_porting_dir = "//third_party/musl/porting/linux/user" 43 44 # if (is_asan) { 45 # musl_linker_asan_name = 46 # musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}-asan" 47 # musl_ldso_path = 48 # musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}-asan." + 49 # musl_linker_extension 50 # } else { 51 # musl_ldso_path = 52 # musl_syslib_dir + "/ld-musl-${musl_arch}${musl_sub_arch}." + 53 # musl_linker_extension 54 # } 55} 56 57declare_args() { 58 if (!is_standard_system) { 59 enable_musl_log = false 60 } 61 musl_iterate_and_stats_api = false 62 musl_secure_level = 1 63} 64 65declare_args() { 66 if (!defined(product_path)) { 67 product_path = "" 68 } 69} 70