From 07311fded03498431d120a5fdfac059aa355c44a Mon Sep 17 00:00:00 2001 From: zfeixiang Date: Sat, 12 Oct 2024 17:24:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9build=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=87=8F=E5=B0=91so=20rom=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zfeixiang --- interfaces/innerkits/code_sign_utils/BUILD.gn | 6 +++++ .../libcode_sign_utils.versionscript | 25 +++++++++++++++++++ interfaces/innerkits/jit_code_sign/BUILD.gn | 5 ++++ interfaces/innerkits/local_code_sign/BUILD.gn | 6 +++++ .../liblocal_code_sign_sdk.versionscript | 23 +++++++++++++++++ services/local_code_sign/BUILD.gn | 5 ++++ 6 files changed, 70 insertions(+) create mode 100644 interfaces/innerkits/code_sign_utils/libcode_sign_utils.versionscript create mode 100644 interfaces/innerkits/local_code_sign/liblocal_code_sign_sdk.versionscript diff --git a/interfaces/innerkits/code_sign_utils/BUILD.gn b/interfaces/innerkits/code_sign_utils/BUILD.gn index ae4a074..2388b49 100644 --- a/interfaces/innerkits/code_sign_utils/BUILD.gn +++ b/interfaces/innerkits/code_sign_utils/BUILD.gn @@ -34,6 +34,12 @@ ohos_shared_library("libcode_sign_utils") { "src/code_sign_utils_in_c.cpp", "src/stat_utils.cpp", ] + version_script = "libcode_sign_utils.versionscript" + cflags_cc = [ + "-Os", + "-fno-asynchronous-unwind-tables", + "-fno-unwind-tables", + ] public_configs = [ "${code_signature_root_dir}:common_public_config", "${code_signature_root_dir}/services/key_enable:key_enable_rust_interface_config", diff --git a/interfaces/innerkits/code_sign_utils/libcode_sign_utils.versionscript b/interfaces/innerkits/code_sign_utils/libcode_sign_utils.versionscript new file mode 100644 index 0000000..8d06b74 --- /dev/null +++ b/interfaces/innerkits/code_sign_utils/libcode_sign_utils.versionscript @@ -0,0 +1,25 @@ +# Copyright (c) 2024 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. + +{ + global: + extern "C++" { + *CodeSignUtils*; + *CodeSignBlock*; + *FsverityUtilsHelper*; + *PKCS7Generator*; + }; + EnforceCodeSign*; + local: + *; +}; \ No newline at end of file diff --git a/interfaces/innerkits/jit_code_sign/BUILD.gn b/interfaces/innerkits/jit_code_sign/BUILD.gn index c215b8f..2a28441 100644 --- a/interfaces/innerkits/jit_code_sign/BUILD.gn +++ b/interfaces/innerkits/jit_code_sign/BUILD.gn @@ -58,6 +58,11 @@ ohos_shared_library("libjit_code_sign") { ] deps = [ ":pac_sign_feature" ] } + cflags_cc = [ + "-Os", + "-fno-asynchronous-unwind-tables", + "-fno-unwind-tables", + ] branch_protector_ret = "pac_ret" sanitize = { cfi = true diff --git a/interfaces/innerkits/local_code_sign/BUILD.gn b/interfaces/innerkits/local_code_sign/BUILD.gn index eeb2f96..fb7c66c 100644 --- a/interfaces/innerkits/local_code_sign/BUILD.gn +++ b/interfaces/innerkits/local_code_sign/BUILD.gn @@ -34,6 +34,12 @@ ohos_shared_library("liblocal_code_sign_sdk") { "src/local_code_sign_load_callback.cpp", "src/local_code_sign_proxy.cpp", ] + version_script = "liblocal_code_sign_sdk.versionscript" + cflags_cc = [ + "-Os", + "-fno-asynchronous-unwind-tables", + "-fno-unwind-tables", + ] public_configs = [ "${code_signature_root_dir}:common_public_config", diff --git a/interfaces/innerkits/local_code_sign/liblocal_code_sign_sdk.versionscript b/interfaces/innerkits/local_code_sign/liblocal_code_sign_sdk.versionscript new file mode 100644 index 0000000..69f45ed --- /dev/null +++ b/interfaces/innerkits/local_code_sign/liblocal_code_sign_sdk.versionscript @@ -0,0 +1,23 @@ +# Copyright (c) 2024 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. + +{ + global: + extern "C++" { + *LocalCodeSignKit*; + *LocalCodeSignLoadCallback*; + *LocalCodeSignClient*; + }; + local: + *; +}; \ No newline at end of file diff --git a/services/local_code_sign/BUILD.gn b/services/local_code_sign/BUILD.gn index acf304b..1672a9d 100644 --- a/services/local_code_sign/BUILD.gn +++ b/services/local_code_sign/BUILD.gn @@ -29,6 +29,11 @@ ohos_shared_library("liblocal_code_sign") { "src/local_sign_key.cpp", "src/permission_utils.cpp", ] + cflags_cc = [ + "-Os", + "-fno-asynchronous-unwind-tables", + "-fno-unwind-tables", + ] include_dirs = [ "include", "${code_signature_root_dir}/interfaces/innerkits/local_code_sign/include", -- Gitee