diff --git a/interfaces/innerkits/init_module_engine/BUILD.gn b/interfaces/innerkits/init_module_engine/BUILD.gn index 3f488733c3127374dd972d31c5ab4dbd830a0b79..04c560beed46e44084db692d27911b51685a910f 100644 --- a/interfaces/innerkits/init_module_engine/BUILD.gn +++ b/interfaces/innerkits/init_module_engine/BUILD.gn @@ -37,6 +37,7 @@ if (defined(ohos_lite)) { # innerkits for module development # ohos_native_stub_library("libinit_module_engine") { + cflags = [ "-fstack-protector-all" ] output_extension = "so" public_configs = [ ":init_module_engine_exported_config" ] stub_description_file = "./stub/libinit.stub.json" @@ -54,6 +55,7 @@ if (defined(ohos_lite)) { # Generate empty library with symlink name to satisfy init loading required libraries # ohos_native_stub_library("libinit_stub_empty") { + cflags = [ "-fstack-protector-all" ] output_extension = "so" stub_description_file = "./stub/libinit.stub.empty.json" part_name = "init" diff --git a/interfaces/kits/syscap/BUILD.gn b/interfaces/kits/syscap/BUILD.gn index 1d9e81f0b970514c8fc24ba7d7c0adfccbca71ac..715c6cf41de1b1b613d53274afc32e28b4bf9d95 100644 --- a/interfaces/kits/syscap/BUILD.gn +++ b/interfaces/kits/syscap/BUILD.gn @@ -14,6 +14,7 @@ import("//build/ohos.gni") ohos_shared_library("deviceinfo_ndk") { + cflags = [ "-fstack-protector-all" ] sources = [ "src/deviceinfo.c", "src/syscap_ndk.c", @@ -25,6 +26,7 @@ ohos_shared_library("deviceinfo_ndk") { } ohos_ndk_library("libdeviceinfo_ndk") { + cflags = [ "-fstack-protector-all" ] output_name = "deviceinfo_ndk" ndk_description_file = "./libdeviceinfo.ndk.json" min_compact_version = "1" diff --git a/services/modules/reboot/BUILD.gn b/services/modules/reboot/BUILD.gn index c5e737d4c4ead299b50098c4f80ac8fcb3d70828..f1ab962d92b1b5912a4c830117ca90d5d9ebdefb 100644 --- a/services/modules/reboot/BUILD.gn +++ b/services/modules/reboot/BUILD.gn @@ -16,7 +16,7 @@ import("//build/ohos.gni") ohos_shared_library("rebootmodule") { sources = [ "reboot.c" ] - + cflags = [ "-fstack-protector-all" ] include_dirs = [ ".", "..", @@ -45,6 +45,7 @@ ohos_source_set("libreboot_static") { "reboot_misc.c", "reboot_static.c", ] + cflags = [ "-fstack-protector-all" ] include_dirs = [ ".", "..",