From bb00f7c5940d07393625d0dd6768b3343a3c74b8 Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Thu, 23 Jan 2025 19:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=9A=90=E7=A7=81=E5=90=88?= =?UTF-8?q?=E8=A7=84=E4=B8=93=E9=A1=B9=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- dfx_utils/BUILD.gn | 8 +++++++- inputdevicehandler/BUILD.gn | 8 +++++++- interfaces/inner_kits/BUILD.gn | 8 +++++++- services/sink/inputcollector/BUILD.gn | 8 +++++++- services/sink/sinkmanager/BUILD.gn | 8 +++++++- services/sink/transport/BUILD.gn | 8 +++++++- services/source/inputinject/BUILD.gn | 8 +++++++- services/source/sourcemanager/BUILD.gn | 8 +++++++- services/source/transport/BUILD.gn | 8 +++++++- services/state/BUILD.gn | 8 +++++++- services/transportbase/BUILD.gn | 8 +++++++- sinkhandler/BUILD.gn | 8 +++++++- sourcehandler/BUILD.gn | 8 +++++++- utils/BUILD.gn | 9 ++++++++- 14 files changed, 99 insertions(+), 14 deletions(-) diff --git a/dfx_utils/BUILD.gn b/dfx_utils/BUILD.gn index 5ed35ce..1a42dd6 100755 --- a/dfx_utils/BUILD.gn +++ b/dfx_utils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -71,6 +71,12 @@ ohos_shared_library("libdinput_dfx_utils") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/inputdevicehandler/BUILD.gn b/inputdevicehandler/BUILD.gn index 5c36f6a..ccbf058 100755 --- a/inputdevicehandler/BUILD.gn +++ b/inputdevicehandler/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -79,6 +79,12 @@ ohos_shared_library("libdinput_handler") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/interfaces/inner_kits/BUILD.gn b/interfaces/inner_kits/BUILD.gn index bcbcb96..f16bc0f 100644 --- a/interfaces/inner_kits/BUILD.gn +++ b/interfaces/inner_kits/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -122,6 +122,12 @@ ohos_shared_library("libdinput_sdk") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/sink/inputcollector/BUILD.gn b/services/sink/inputcollector/BUILD.gn index 57cb891..f4ab40d 100755 --- a/services/sink/inputcollector/BUILD.gn +++ b/services/sink/inputcollector/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -78,6 +78,12 @@ ohos_shared_library("libdinput_collector") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/sink/sinkmanager/BUILD.gn b/services/sink/sinkmanager/BUILD.gn index 0c65940..11254ba 100644 --- a/services/sink/sinkmanager/BUILD.gn +++ b/services/sink/sinkmanager/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -101,6 +101,12 @@ ohos_shared_library("libdinput_sink") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/sink/transport/BUILD.gn b/services/sink/transport/BUILD.gn index d82ddc2..15422c9 100644 --- a/services/sink/transport/BUILD.gn +++ b/services/sink/transport/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -83,6 +83,12 @@ ohos_shared_library("libdinput_sink_trans") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/source/inputinject/BUILD.gn b/services/source/inputinject/BUILD.gn index 0c84f71..d767d90 100644 --- a/services/source/inputinject/BUILD.gn +++ b/services/source/inputinject/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -85,6 +85,12 @@ ohos_shared_library("libdinput_inject") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/source/sourcemanager/BUILD.gn b/services/source/sourcemanager/BUILD.gn index aa02846..cc54970 100644 --- a/services/source/sourcemanager/BUILD.gn +++ b/services/source/sourcemanager/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -136,6 +136,12 @@ ohos_shared_library("libdinput_source") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/source/transport/BUILD.gn b/services/source/transport/BUILD.gn index f5431b6..952d72c 100755 --- a/services/source/transport/BUILD.gn +++ b/services/source/transport/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -81,6 +81,12 @@ ohos_shared_library("libdinput_source_trans") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/state/BUILD.gn b/services/state/BUILD.gn index 20e77df..e6a4582 100644 --- a/services/state/BUILD.gn +++ b/services/state/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023-2024 Huawei Device Co., Ltd. +# Copyright (c) 2023-2025 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 @@ -83,6 +83,12 @@ ohos_shared_library("libdinput_sink_state") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/services/transportbase/BUILD.gn b/services/transportbase/BUILD.gn index 622f14e..e41d5cc 100644 --- a/services/transportbase/BUILD.gn +++ b/services/transportbase/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -79,6 +79,12 @@ ohos_shared_library("libdinput_trans_base") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/sinkhandler/BUILD.gn b/sinkhandler/BUILD.gn index b9a2c76..3473cc4 100644 --- a/sinkhandler/BUILD.gn +++ b/sinkhandler/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -81,6 +81,12 @@ ohos_shared_library("libdinput_sink_handler") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/sourcehandler/BUILD.gn b/sourcehandler/BUILD.gn index 1ba3d88..ef92104 100644 --- a/sourcehandler/BUILD.gn +++ b/sourcehandler/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -84,6 +84,12 @@ ohos_shared_library("libdinput_source_handler") { "-O2", ] + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + subsystem_name = "distributedhardware" part_name = "distributed_input" diff --git a/utils/BUILD.gn b/utils/BUILD.gn index af7c746..10d6c62 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -47,10 +47,17 @@ ohos_shared_library("libdinput_utils") { cflags = [ "-O2", "-D_FORTIFY_SOURCE=2", + "-fstack-protector-strong", ] cflags_cc = cflags + ldflags = [ + "-fpie", + "-Wl,-z,relro", + "-Wl,-z,now", + ] + external_deps = [ "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", -- Gitee