Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions projects/rccl/cmake/DeviceLinker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ if(_rccl_copts)
endif()
message(STATUS "Device Linker: inherited compile options: ${DL_INHERITED_FLAGS}")

# The --link step is the one consumer that cannot take a -fvisibility= option:
# the ncclDevFunc_* device functions have to stay visible, or the device link
# fails with "recompile with -fPIC". The host objects below still need it.
set(DL_LINK_INHERITED_FLAGS "")
foreach(_opt IN LISTS DL_INHERITED_FLAGS)
if(_opt MATCHES "^-fvisibility=")
continue()
endif()
list(APPEND DL_LINK_INHERITED_FLAGS "${_opt}")
endforeach()

# ---------------------------------------------------------------------------
# Parse GPU_TARGETS: strip target features, build offload-arch flag list
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -369,6 +380,7 @@ foreach(DL_GPU_TARGET ${DL_GPU_TARGETS})
${_link_def_flags}
${_link_inc_flags}
${DL_OPT_FLAGS}
${DL_LINK_INHERITED_FLAGS}
-std=c++17
-o ${ARCH_DEVICE_ELF}
@${_link_rsp}
Expand Down
Loading