diff --git a/interfaces/innerkits/code_sign_utils/BUILD.gn b/interfaces/innerkits/code_sign_utils/BUILD.gn index ae4a07446f34572960b575948798b16a676de8ef..2388b49d18515b96f4cdb2c586a98d36b483f04d 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 0000000000000000000000000000000000000000..8d06b74efbd6580c87530fa0dd1018361b0e4c9a --- /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 c215b8f7eee627937f7f881e5337838a404f2e8c..2a28441dfe112a38f2e0f8dd0d31937e918ddf3d 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 eeb2f965d352962283d87c12bd25f05e26774da9..fb7c66c4c51b4a4082839a9e350fdf719252c7bc 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 0000000000000000000000000000000000000000..69f45ed11d8682569371b4dbcaf2546ece91752f --- /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 acf304b21b29ad504a2f294e384a9ddabf44a254..1672a9df91a3554169862aa38ec8b7732f4b1aea 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",