1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/config/clang/clang.gni") 15import("//build/ohos.gni") 16 17ohos_prebuilt_shared_library("libclang_rt.asan.so") { 18 enable_strip = true 19 mini_debug = true 20 source = "${runtime_clang_path}/libclang_rt.asan.so" 21 deps = [ ":asan_unstripped_copy" ] 22 install_images = [ 23 "system", 24 "ramdisk", 25 "updater", 26 ] 27 subsystem_name = "build" 28 part_name = "build_framework" 29} 30 31ohos_prebuilt_shared_library("libclang_rt.hwasan.so") { 32 enable_strip = true 33 mini_debug = true 34 source = "${runtime_ohos_clang_path}/libclang_rt.hwasan.so" 35 install_images = [ 36 "system", 37 "updater", 38 ] 39 if (use_hwasan) { 40 install_images += [ "ramdisk" ] 41 } 42 subsystem_name = "build" 43 part_name = "build_framework" 44} 45 46ohos_prebuilt_shared_library("libclang_rt.tsan.so") { 47 enable_strip = true 48 mini_debug = true 49 source = "${runtime_ohos_clang_path}/libclang_rt.tsan.so" 50 if (is_tsan) { 51 deps = [ ":tsan_unstripped_copy" ] 52 } 53 54 install_images = [ 55 "system", 56 "ramdisk", 57 "updater", 58 ] 59 subsystem_name = "build" 60 part_name = "build_framework" 61} 62 63ohos_prebuilt_etc("asan.options") { 64 source = "asan.options" 65 subsystem_name = "build" 66 part_name = "build_framework" 67} 68 69ohos_prebuilt_etc("asan.cfg") { 70 source = "asan.cfg" 71 module_install_dir = "etc/init/" 72 subsystem_name = "build" 73 part_name = "build_framework" 74} 75 76copy("asan_unstripped_copy") { 77 sources = [ "${runtime_clang_path}/libclang_rt.asan.so" ] 78 outputs = [ root_out_dir + "/lib.unstripped/clang/{{source_file_part}}" ] 79} 80 81copy("tsan_unstripped_copy") { 82 sources = [ "${runtime_clang_path}/libclang_rt.tsan.so" ] 83 outputs = [ root_out_dir + "/lib.unstripped/clang/{{source_file_part}}" ] 84} 85 86ohos_prebuilt_etc("tsan.options") { 87 source = "tsan.options" 88 subsystem_name = "build" 89 part_name = "build_framework" 90} 91