# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License import("//build/config/clang/clang.gni") import("//build/config/ohos/musl.gni") import("//build/ohos.gni") group("musl_install") { deps = [ ":ld-musl-arm.so.1", ":musl-libc.so", ":musl-libcxx.so", ":musl_ld_path_etc_cfg", "//third_party/musl:musl_libs", ] } ohos_prebuilt_shared_library("ld-musl-arm.so.1") { deps = [ "//third_party/musl:soft_create_linker" ] if (is_asan) { asan = "-asan" } else { asan = "" } _musl_linker_so = "${root_out_dir}/common/common/libc/./ld-musl-${musl_arch}${asan}.so.1" source = _musl_linker_so install_enable = true install_images = [ "system", "updater", "ramdisk", ] part_name = "common" module_install_dir = "lib" } ohos_prebuilt_shared_library("musl-libc.so") { deps = [ "//third_party/musl:soft_libc_musl_shared" ] source = "${musl_sysroot}/usr/lib/${musl_target_triple}/libc.so" install_images = [ "system", "updater", "ramdisk", ] part_name = "common" } ohos_prebuilt_etc("musl_ld_path_etc_cfg") { if (target_cpu == "arm") { source = "ld-musl-arm.path" } else { source = "ld-musl-aarch64.path" } if (is_asan) { output = string_replace(source, ".path", "-asan.path") } install_images = [ "system", "updater", "ramdisk", ] part_name = "common" } ohos_prebuilt_shared_library("musl-libcxx.so") { enable_strip = true if (target_cpu == "arm") { source = "${clang_base_path}/lib/arm-linux-ohos/libc++.so" } else if (target_cpu == "arm64") { source = "${clang_base_path}/lib/aarch64-linux-ohos/libc++.so" } else if (target_cpu == "x86_64") { source = "${clang_base_path}/lib/x86_64-linux-ohos/libc++.so" } else { source = "" } install_images = [ "system", "updater", ] part_name = "common" }