Genex-LINK_GROUP: Add feature RESCAN

Feature RESCAN can be used to manage circular references between
static libraries.
This commit is contained in:
Marc Chevrier
2022-03-02 17:32:44 +01:00
parent a950fd9553
commit b0fada9964
11 changed files with 92 additions and 4 deletions
+8
View File
@@ -19,6 +19,14 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
endforeach()
# Features for LINK_GROUP generator expression
## RESCAN: request the linker to rescan static libraries until there is
## no pending undefined symbols
set(CMAKE_LINK_GROUP_USING_RESCAN "LINKER:--start-group" "LINKER:--end-group")
set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED TRUE)
# Debian policy requires that shared libraries be installed without
# executable permission. Fedora policy requires that shared libraries
# be installed with the executable permission. Since the native tools
+10
View File
@@ -7,6 +7,16 @@ if(CMAKE_SYSTEM MATCHES "SunOS-4")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
endif()
# Features for LINK_GROUP generator expression
if (CMAKE_SYSTEM_VERSION VERSION_GREATER "5.9")
## RESCAN: request the linker to rescan static libraries until there is
## no pending undefined symbols
set(CMAKE_LINK_GROUP_USING_RESCAN "LINKER:-z,rescan-start" "LINKER:-z,rescan-end")
set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED TRUE)
endif()
include(Platform/UnixPaths)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+8
View File
@@ -44,6 +44,14 @@ if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]")
set(__WINDOWS_GNU_LD_RESPONSE 0)
endif()
# Features for LINK_GROUP generator expression
## RESCAN: request the linker to rescan static libraries until there is
## no pending undefined symbols
set(CMAKE_LINK_GROUP_USING_RESCAN "LINKER:--start-group" "LINKER:--end-group")
set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED TRUE)
macro(__windows_compiler_gnu lang)
# Create archiving rules to support large object file lists for static libraries.