diff --git a/dfx_utils/BUILD.gn b/dfx_utils/BUILD.gn index 5ed35ceae89a27b7eac26564ce591088ec2e01db..1a42dd6a022d3b026833fb602b84335f2001895b 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 5c36f6a5c291ddba11d11f1da6005fbd6ea56181..ccbf0586bd724eeba41d563d1adfbec86ec7d218 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 bcbcb96146ffbbc488738ad87f5ede788e433964..f16bc0f52d60acce54849755b2678c7358a71033 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 57cb89159092e389a0de4cb4d8c531a3a6f0b4ff..f4ab40d5f2a14d375d014fac3ed3b660b0869c0b 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 0c659407b4ba33b0f73d6c9a6e0bd8a177c1526d..11254ba4affaaedc21023ff41ff2245f1bfe09f8 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 d82ddc2bc28aa3dc11fa774e787e390ce4f0bf5a..15422c99edd70f7fc0b67c487b87b13f170aea3f 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 0c84f71d0bdcd6a83d7951a10b5dc3e7ad10296c..d767d906841f5622465fb9195b96a3c778d108d6 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 aa02846825ffc0a613edd4d3defea3cb90b6e540..cc54970b716a07147d228015562b46d076cbbf1a 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 f5431b6bf30e638237e5262ba100d8ba09cdc1bf..952d72c922e4a8e0154905ea97af72563e221095 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 20e77dfd9a7f2ef5a5015ecb68e492d5733f8ffc..e6a458226b702ff59240e593280fe18760ccfede 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 622f14e736ffdda4bdf8824205a4e43b434c667b..e41d5ccd69e8262c7b3e30f223b30419937839af 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 b9a2c76946e8abfe8d815cb747becfb6ab6796de..3473cc49f001ea4f9f862073972f4e842054b63f 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 1ba3d8803ee9c891598e01c397c38c0666fbcb67..ef92104ffd9d06ef96e10c6140add7d12d7a7a58 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 af7c74669168056a68733ed8aed26c66a52258e0..10d6c624b3c043c741237fb7ccc38bfba92535a2 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",