Browse Source

!800 add -fno-common and remove redundant dependency

From: @taoxudonghaha
Reviewed-by: @ji_chen,@wqtshg
Signed-off-by: @ji_chen
tags/v1.2.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
7ba841f3bb
10 changed files with 22 additions and 14 deletions
  1. +2
    -2
      ge/CMakeLists.txt
  2. +2
    -1
      ge/common/CMakeLists.txt
  3. +1
    -1
      ge/executor/CMakeLists.txt
  4. +5
    -4
      ge/ge_local_engine/CMakeLists.txt
  5. +1
    -0
      ge/graph/build/memory/CMakeLists.txt
  6. +5
    -4
      ge/host_cpu_engine/CMakeLists.txt
  7. +3
    -0
      ge/offline/CMakeLists.txt
  8. +1
    -0
      ge/plugin/engine/CMakeLists.txt
  9. +1
    -1
      metadef
  10. +1
    -1
      parser

+ 2
- 2
ge/CMakeLists.txt View File

@@ -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


+ 2
- 1
ge/common/CMakeLists.txt View File

@@ -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
$<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations>
$<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations -fno-common>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)


+ 1
- 1
ge/executor/CMakeLists.txt View File

@@ -162,7 +162,7 @@ set(SRC_LIST
add_library(ge_executor STATIC ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(ge_executor PRIVATE
$<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations>
$<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations -fno-common>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)


+ 5
- 4
ge/ge_local_engine/CMakeLists.txt View File

@@ -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


+ 1
- 0
ge/graph/build/memory/CMakeLists.txt View File

@@ -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


+ 5
- 4
ge/host_cpu_engine/CMakeLists.txt View File

@@ -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


+ 3
- 0
ge/offline/CMakeLists.txt View File

@@ -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


+ 1
- 0
ge/plugin/engine/CMakeLists.txt View File

@@ -8,6 +8,7 @@ add_library(engine SHARED ${SRC_LIST})

target_compile_options(engine PRIVATE
-Werror
-fno-common
)

target_compile_definitions(engine PRIVATE


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit e96b3d797ad7611357cc4f460e719a83aba3fc3d
Subproject commit 3044f2da694cd61f5d9946709134cbcc849190e4

+ 1
- 1
parser

@@ -1 +1 @@
Subproject commit 34559943b6cb645042a87d99bc88ead016b15b64
Subproject commit ecde83dc9da0d58522b4a90c4d90c242c75011fd

Loading…
Cancel
Save