Add linker script optimization flag to CMAKE rule for CUDA ARM wheel (#127514)

Original PR - https://github.com/pytorch/pytorch/pull/127220

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127514
Approved by: https://github.com/Aidyn-A, https://github.com/atalman
This commit is contained in:
Ting Lu
2024-06-04 20:51:41 +00:00
committed by PyTorch MergeBot
parent 6dc0a291b9
commit 1b704a160f
2 changed files with 5 additions and 0 deletions

View File

@ -540,6 +540,8 @@ option(BUILD_EXECUTORCH "Master flag to build Executorch" ON)
if(LINUX)
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed")
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} $ENV{LDFLAGS}")
endif()
if(MSVC)

View File

@ -14,6 +14,9 @@ function(caffe2_print_configuration_summary)
message(STATUS " Found ccache : ${CCACHE_PROGRAM}")
endif()
message(STATUS " CXX flags : ${CMAKE_CXX_FLAGS}")
message(STATUS " Shared LD flags : ${CMAKE_SHARED_LINKER_FLAGS}")
message(STATUS " Static LD flags : ${CMAKE_STATIC_LINKER_FLAGS}")
message(STATUS " Module LD flags : ${CMAKE_MODULE_LINKER_FLAGS}")
message(STATUS " Build type : ${CMAKE_BUILD_TYPE}")
get_directory_property(tmp DIRECTORY ${PROJECT_SOURCE_DIR} COMPILE_DEFINITIONS)
message(STATUS " Compile definitions : ${tmp}")