diff --git a/BUILD.gn b/BUILD.gn index a8412e96df19f744be2ca125df98677729e338f6..794c65528430860fe92d601d5e6b45998158ae83 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -252,6 +252,7 @@ template("build_hdc") { if (image_name == "system") { if (product_name != "ohos-sdk" || is_emulator) { ohos_executable("hdcd_${image_name}_exe") { + branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true @@ -313,6 +314,7 @@ template("build_hdc") { } } else { ohos_executable("hdcd_${image_name}_exe") { + branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true @@ -402,6 +404,9 @@ ohos_executable("hdc") { ] if (is_ohos) { + if (build_variant == "user") { + defines += [ "IS_RELEASE_VERSION" ] + } sources += [ "src/common/credential_message.cpp" ] sources += [ "src/common/hdc_huks.cpp" ] sources += [ "src/common/password.cpp" ] diff --git a/credential/BUILD.gn b/credential/BUILD.gn index 0e7ad2115cf51fe7874304f90dca49a94913f3c2..38fed3e9300fa3cb38b80c0d29cc2567d288190b 100644 --- a/credential/BUILD.gn +++ b/credential/BUILD.gn @@ -27,6 +27,9 @@ config("hdc_config") { ohos_executable("hdc_credential_exec") { if (hdc_feature_support_credential) { + if (build_variant == "user") { + defines += [ "IS_RELEASE_VERSION" ] + } use_exceptions = true ldflags = [ "-Wl,--whole-archive",