From e79fc4c2bd5edc23e14cbbe720c50cf77827da6c Mon Sep 17 00:00:00 2001 From: taoxudonghaha Date: Tue, 29 Dec 2020 16:36:26 +0800 Subject: [PATCH] add -fno-common and remove redundant dependency --- ge/CMakeLists.txt | 4 ++-- ge/common/CMakeLists.txt | 3 ++- ge/executor/CMakeLists.txt | 2 +- ge/ge_local_engine/CMakeLists.txt | 9 +++++---- ge/graph/build/memory/CMakeLists.txt | 1 + ge/host_cpu_engine/CMakeLists.txt | 9 +++++---- ge/offline/CMakeLists.txt | 3 +++ ge/plugin/engine/CMakeLists.txt | 1 + metadef | 2 +- parser | 2 +- 10 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 88d74730..5960da1a 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -625,6 +625,7 @@ target_compile_definitions(ge_runner PRIVATE target_compile_options(ge_runner PRIVATE -O2 + -fno-common ) target_include_directories(ge_runner PRIVATE @@ -669,7 +670,6 @@ target_link_libraries(ge_runner PRIVATE c_sec slog runtime - resource error_manager ascend_hal_stub -Wl,--as-needed @@ -693,6 +693,7 @@ target_compile_definitions(ge_compiler PRIVATE target_compile_options(ge_compiler PRIVATE -O2 + -fno-common ) target_include_directories(ge_compiler PRIVATE @@ -734,7 +735,6 @@ target_link_libraries(ge_compiler PRIVATE error_manager slog runtime_compile - resource -Wl,--as-needed json -lrt diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 05838df8..bb08570a 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -80,6 +80,7 @@ target_compile_options(ge_common PRIVATE -O2 -Werror -Wno-deprecated-declarations + -fno-common ) target_include_directories(ge_common PRIVATE @@ -134,7 +135,7 @@ target_compile_definitions(ge_common_static PRIVATE ) target_compile_options(ge_common_static PRIVATE - $<$,$>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations> + $<$,$>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations -fno-common> $<$,$>:/MTd> $<$,$>:/MT> ) diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index ee815550..8e548815 100644 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -162,7 +162,7 @@ set(SRC_LIST add_library(ge_executor STATIC ${SRC_LIST} ${PROTO_HDRS}) target_compile_options(ge_executor PRIVATE - $<$,$>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations> + $<$,$>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations -fno-common> $<$,$>:/MTd> $<$,$>:/MT> ) diff --git a/ge/ge_local_engine/CMakeLists.txt b/ge/ge_local_engine/CMakeLists.txt index 8f5c9777..7189e8ff 100755 --- a/ge/ge_local_engine/CMakeLists.txt +++ b/ge/ge_local_engine/CMakeLists.txt @@ -26,6 +26,7 @@ add_library(ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS}) target_compile_options(ge_local_engine PRIVATE -Werror + -fno-common ) target_compile_definitions(ge_local_engine PRIVATE @@ -55,10 +56,8 @@ target_link_libraries(ge_local_engine PRIVATE -Wl,--no-as-needed graph ascend_protobuf - register c_sec slog - runtime -Wl,--as-needed ) @@ -67,6 +66,7 @@ add_library(atc_ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS}) target_compile_options(atc_ge_local_engine PRIVATE -Werror + -fno-common ) target_compile_definitions(atc_ge_local_engine PRIVATE @@ -97,10 +97,8 @@ target_link_libraries(atc_ge_local_engine PRIVATE -Wl,--no-as-needed graph ascend_protobuf - register c_sec slog - runtime_compile -Wl,--as-needed ) @@ -114,6 +112,7 @@ add_library(ge_local_opskernel_builder SHARED ${OPS_KERNEL_SRC_LIST} ${PROTO_HDR target_compile_options(ge_local_opskernel_builder PRIVATE -Werror + -fno-common ) target_compile_definitions(ge_local_opskernel_builder PRIVATE @@ -154,6 +153,7 @@ add_library(atc_ge_local_opskernel_builder SHARED ${OPS_KERNEL_SRC_LIST} ${PROTO target_compile_options(atc_ge_local_opskernel_builder PRIVATE -Werror + -fno-common ) target_compile_definitions(atc_ge_local_opskernel_builder PRIVATE @@ -199,6 +199,7 @@ add_library(ge_local_opskernel_builder_static STATIC ${OPS_KERNEL_SRC_LIST} ${PR target_compile_options(ge_local_opskernel_builder_static PRIVATE -Werror + -fno-common ) target_compile_definitions(ge_local_opskernel_builder_static PRIVATE diff --git a/ge/graph/build/memory/CMakeLists.txt b/ge/graph/build/memory/CMakeLists.txt index e988b4ce..126e0187 100644 --- a/ge/graph/build/memory/CMakeLists.txt +++ b/ge/graph/build/memory/CMakeLists.txt @@ -14,6 +14,7 @@ add_library(ge_memory STATIC ${SRC_LIST}) target_compile_options(ge_memory PRIVATE -Werror -O2 + -fno-common ) target_compile_definitions(ge_memory PRIVATE diff --git a/ge/host_cpu_engine/CMakeLists.txt b/ge/host_cpu_engine/CMakeLists.txt index d5ed7674..cbd0bd8b 100644 --- a/ge/host_cpu_engine/CMakeLists.txt +++ b/ge/host_cpu_engine/CMakeLists.txt @@ -20,6 +20,7 @@ add_library(host_cpu_engine SHARED ${SRC_LIST} ${PROTO_HDRS}) target_compile_options(host_cpu_engine PRIVATE -Werror + -fno-common ) target_compile_definitions(host_cpu_engine PRIVATE @@ -49,9 +50,7 @@ target_link_libraries(host_cpu_engine PRIVATE ascend_protobuf c_sec graph - register slog - runtime -Wl,--as-needed ) @@ -60,6 +59,7 @@ add_library(atc_host_cpu_engine SHARED ${SRC_LIST} ${PROTO_HDRS}) target_compile_options(atc_host_cpu_engine PRIVATE -Werror + -fno-common ) target_compile_definitions(atc_host_cpu_engine PRIVATE @@ -90,9 +90,7 @@ target_link_libraries(atc_host_cpu_engine PRIVATE ascend_protobuf c_sec graph - register slog - runtime_compile -Wl,--as-needed ) @@ -106,6 +104,7 @@ add_library(host_cpu_opskernel_builder SHARED ${CPU_OPS_KERNEL_LIST}) target_compile_options(host_cpu_opskernel_builder PRIVATE -Werror + -fno-common ) target_compile_definitions(host_cpu_opskernel_builder PRIVATE @@ -145,6 +144,7 @@ add_library(atc_host_cpu_opskernel_builder SHARED ${CPU_OPS_KERNEL_LIST}) target_compile_options(atc_host_cpu_opskernel_builder PRIVATE -Werror + -fno-common ) target_compile_definitions(atc_host_cpu_opskernel_builder PRIVATE @@ -189,6 +189,7 @@ add_library(host_cpu_opskernel_builder_static STATIC ${CPU_OPS_KERNEL_LIST}) target_compile_options(host_cpu_opskernel_builder_static PRIVATE -Werror + -fno-common ) target_compile_definitions(host_cpu_opskernel_builder_static PRIVATE diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index 48c1cbe7..d195e06f 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -22,6 +22,7 @@ target_compile_options(atc PRIVATE -Werror -O2 -Wno-deprecated-declarations + -fno-common ) target_compile_definitions(atc PRIVATE @@ -83,6 +84,7 @@ target_compile_options(atc_atc.bin PRIVATE -Werror -O2 -Wno-deprecated-declarations + -fno-common ) target_compile_definitions(atc_atc.bin PRIVATE @@ -149,6 +151,7 @@ target_compile_options(fwk_atc.bin PRIVATE -Werror -O2 -Wno-deprecated-declarations + -fno-common ) target_compile_definitions(fwk_atc.bin PRIVATE diff --git a/ge/plugin/engine/CMakeLists.txt b/ge/plugin/engine/CMakeLists.txt index 87a6d682..f6353231 100644 --- a/ge/plugin/engine/CMakeLists.txt +++ b/ge/plugin/engine/CMakeLists.txt @@ -8,6 +8,7 @@ add_library(engine SHARED ${SRC_LIST}) target_compile_options(engine PRIVATE -Werror + -fno-common ) target_compile_definitions(engine PRIVATE diff --git a/metadef b/metadef index e96b3d79..3044f2da 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit e96b3d797ad7611357cc4f460e719a83aba3fc3d +Subproject commit 3044f2da694cd61f5d9946709134cbcc849190e4 diff --git a/parser b/parser index 34559943..ecde83dc 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit 34559943b6cb645042a87d99bc88ead016b15b64 +Subproject commit ecde83dc9da0d58522b4a90c4d90c242c75011fd