Skip to content

Commit 8bb2aff

Browse files
committed
build: add DT_SONAME for ELF libraries
Unfortunately, because we do not use CMake for generating the libraries, we need to explicitly control the library names for the time being. Add a DT_SONAME entry to the ELF binary that we generate to ensure that we are able to properly link to the libraries at load time.
1 parent b7c12c2 commit 8bb2aff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/modules/SwiftSupport.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ function(add_swift_target target)
133133
file(WRITE ${rsp_file} ${rsp_text})
134134

135135
if(AST_LIBRARY)
136+
if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
136137
set(emit_library -emit-library)
138+
else()
139+
set(emit_library -emit-library -Xlinker -soname -Xlinker ${AST_OUTPUT})
140+
endif()
137141
endif()
138142
if(NOT AST_LIBRARY OR library_kind STREQUAL SHARED)
139143
add_custom_command(OUTPUT

0 commit comments

Comments
 (0)