From b503275483e66ff27d45c81e06bf3ef6caf2f0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=88=E7=9A=93=E6=9D=B0?= Date: Thu, 9 Jan 2025 15:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 师皓杰 --- audiohandler/BUILD.gn | 6 ++++++ interfaces/inner_kits/native_cpp/audio_sink/BUILD.gn | 6 ++++++ interfaces/inner_kits/native_cpp/audio_source/BUILD.gn | 6 ++++++ services/audiomanager/servicesink/BUILD.gn | 6 ++++++ services/audiomanager/servicesource/BUILD.gn | 6 ++++++ services/audiotransport/receiverengine/BUILD.gn | 6 ++++++ services/audiotransport/senderengine/BUILD.gn | 6 ++++++ services/common/BUILD.gn | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/audiohandler/BUILD.gn b/audiohandler/BUILD.gn index 2c58997b..683a1910 100644 --- a/audiohandler/BUILD.gn +++ b/audiohandler/BUILD.gn @@ -52,6 +52,12 @@ ohos_shared_library("distributed_audio_handler") { cflags = [ "-Wno-shadow" ] cflags_cc = cflags + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_audio" diff --git a/interfaces/inner_kits/native_cpp/audio_sink/BUILD.gn b/interfaces/inner_kits/native_cpp/audio_sink/BUILD.gn index ffb1b4ea..a7d027bd 100755 --- a/interfaces/inner_kits/native_cpp/audio_sink/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/audio_sink/BUILD.gn @@ -41,6 +41,12 @@ ohos_shared_library("distributed_audio_sink_sdk") { "src/daudio_sink_proxy.cpp", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + deps = [ "${services_path}/common:distributed_audio_utils" ] external_deps = [ diff --git a/interfaces/inner_kits/native_cpp/audio_source/BUILD.gn b/interfaces/inner_kits/native_cpp/audio_source/BUILD.gn index c16839f7..750e93a6 100755 --- a/interfaces/inner_kits/native_cpp/audio_source/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/audio_source/BUILD.gn @@ -41,6 +41,12 @@ ohos_shared_library("distributed_audio_source_sdk") { "src/daudio_source_proxy.cpp", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + deps = [ "${services_path}/common:distributed_audio_utils" ] external_deps = [ diff --git a/services/audiomanager/servicesink/BUILD.gn b/services/audiomanager/servicesink/BUILD.gn index d05c40b9..cd83fc45 100755 --- a/services/audiomanager/servicesink/BUILD.gn +++ b/services/audiomanager/servicesink/BUILD.gn @@ -66,6 +66,12 @@ ohos_shared_library("distributed_audio_sink") { "src/daudio_sink_stub.cpp", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + deps = [ "${audio_transport_path}/receiverengine:distributed_audio_decode_transport", "${audio_transport_path}/senderengine:distributed_audio_encode_transport", diff --git a/services/audiomanager/servicesource/BUILD.gn b/services/audiomanager/servicesource/BUILD.gn index dff175d0..5fd26612 100755 --- a/services/audiomanager/servicesource/BUILD.gn +++ b/services/audiomanager/servicesource/BUILD.gn @@ -127,6 +127,12 @@ ohos_shared_library("distributed_audio_source") { cflags_cc = cflags + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + defines = [ "HI_LOG_ENABLE", "LOG_DOMAIN=0xD004130", diff --git a/services/audiotransport/receiverengine/BUILD.gn b/services/audiotransport/receiverengine/BUILD.gn index 17e48c8e..7f019d32 100644 --- a/services/audiotransport/receiverengine/BUILD.gn +++ b/services/audiotransport/receiverengine/BUILD.gn @@ -54,6 +54,12 @@ ohos_shared_library("distributed_audio_decode_transport") { "${audio_transport_path}/receiverengine/src/av_receiver_engine_transport.cpp", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + deps = [ "${services_path}/common:distributed_audio_utils" ] external_deps = [ diff --git a/services/audiotransport/senderengine/BUILD.gn b/services/audiotransport/senderengine/BUILD.gn index 2292ecb4..0052d6bc 100644 --- a/services/audiotransport/senderengine/BUILD.gn +++ b/services/audiotransport/senderengine/BUILD.gn @@ -54,6 +54,12 @@ ohos_shared_library("distributed_audio_encode_transport") { "${audio_transport_path}/senderengine/src/av_sender_engine_transport.cpp", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + deps = [ "${services_path}/common:distributed_audio_utils" ] external_deps = [ diff --git a/services/common/BUILD.gn b/services/common/BUILD.gn index cbf99f90..083b753b 100644 --- a/services/common/BUILD.gn +++ b/services/common/BUILD.gn @@ -55,6 +55,12 @@ ohos_shared_library("distributed_audio_utils") { "audiodata/src/audio_data.cpp", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + external_deps = [ "cJSON:cjson", "c_utils:utils", -- Gitee