Skip to content

Remove swiftImageInspectionShared #15692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ if(SWIFT_CHECK_ESSENTIAL_STDLIB)
endif()


set(shared_only_libs)
if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
list(APPEND shared_only_libs swiftImageInspectionShared)
endif()

add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE
${SWIFTLIB_SOURCES}
# The copy_shim_headers target dependency is required to let the
Expand All @@ -264,6 +259,5 @@ add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STD
LINK_FLAGS ${swift_core_link_flags}
PRIVATE_LINK_LIBRARIES ${swift_core_private_link_libraries}
INCORPORATE_OBJECT_LIBRARIES swiftRuntime swiftStdlibStubs
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY ${shared_only_libs}
FRAMEWORK_DEPENDS ${swift_core_framework_depends}
INSTALL_IN_COMPONENT stdlib)
79 changes: 30 additions & 49 deletions stdlib/public/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
set(swift_runtime_compile_flags ${SWIFT_RUNTIME_CORE_CXX_FLAGS})
set(swift_runtime_linker_flags ${SWIFT_RUNTIME_CORE_LINK_FLAGS})

set(ELFISH_SDKS)
set(COFF_SDKS)
foreach(sdk ${SWIFT_CONFIGURED_SDKS})
if("${SWIFT_SDK_${sdk}_OBJECT_FORMAT}" STREQUAL "ELF")
list(APPEND ELFISH_SDKS ${sdk})
elseif("${SWIFT_SDK_${sdk}_OBJECT_FORMAT}" STREQUAL "COFF")
list(APPEND COFF_SDKS ${sdk})
endif()
endforeach()

if(SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT)
list(APPEND swift_runtime_compile_flags
"-DSWIFT_DARWIN_ENABLE_STABLE_ABI_BIT=1")
Expand Down Expand Up @@ -88,47 +98,28 @@ set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
list(APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS)
list(APPEND swift_runtime_library_compile_flags -I${SWIFT_SOURCE_DIR}/include)

set(sdk "${SWIFT_HOST_VARIANT_SDK}")
if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
list(REMOVE_ITEM swift_runtime_sources ImageInspectionELF.cpp)
if(SWIFT_BUILD_STATIC_STDLIB)
set(static_binary_lnk_file_list)
string(TOLOWER "${sdk}" lowercase_sdk)

# These two libraries are only used with the static swiftcore
add_swift_library(swiftImageInspectionShared STATIC
ImageInspectionELF.cpp
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
LINK_FLAGS ${swift_runtime_linker_flags})
set_target_properties(swiftImageInspectionShared PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${SWIFTSTATICLIB_DIR}/${lowercase_sdk}")

swift_install_in_component(stdlib
TARGETS swiftImageInspectionShared
DESTINATION "lib/swift_static/${lowercase_sdk}")

# Generate the static-executable-args.lnk file used for ELF systems (eg linux)
set(linkfile "${lowercase_sdk}/static-executable-args.lnk")
add_custom_command_target(swift_static_binary_${sdk}_args
COMMAND
"${CMAKE_COMMAND}" -E copy
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk"
"${SWIFTSTATICLIB_DIR}/${linkfile}"
OUTPUT
"${SWIFTSTATICLIB_DIR}/${linkfile}"
DEPENDS
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk")

list(APPEND static_binary_lnk_file_list ${swift_static_binary_${sdk}_args})
swift_install_in_component(stdlib
FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
DESTINATION "lib/swift_static/${lowercase_sdk}")
foreach(sdk ${ELFISH_SDKS})

string(TOLOWER "${sdk}" lowercase_sdk)
set(linkfile "${lowercase_sdk}/static-executable-args.lnk")
add_custom_command_target(swift_static_binary_${sdk}_args
COMMAND
"${CMAKE_COMMAND}" -E copy
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk"
"${SWIFTSTATICLIB_DIR}/${linkfile}"
OUTPUT
"${SWIFTSTATICLIB_DIR}/${linkfile}"
DEPENDS
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk")

list(APPEND static_binary_lnk_file_list ${swift_static_binary_${sdk}_args})
swift_install_in_component(stdlib
FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
DESTINATION "lib/swift_static/${lowercase_sdk}")
endforeach()
add_custom_target(static_binary_magic ALL DEPENDS ${static_binary_lnk_file_list})

add_swift_library(swiftImageInspectionShared OBJECT_LIBRARY TARGET_LIBRARY
ImageInspectionELF.cpp
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
LINK_FLAGS ${swift_runtime_linker_flags}
INSTALL_IN_COMPONENT never_install)
endif()

add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
Expand All @@ -139,16 +130,6 @@ add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
LINK_FLAGS ${swift_runtime_linker_flags}
INSTALL_IN_COMPONENT never_install)

set(ELFISH_SDKS)
set(COFF_SDKS)
foreach(sdk ${SWIFT_CONFIGURED_SDKS})
if("${SWIFT_SDK_${sdk}_OBJECT_FORMAT}" STREQUAL "ELF")
list(APPEND ELFISH_SDKS ${sdk})
elseif("${SWIFT_SDK_${sdk}_OBJECT_FORMAT}" STREQUAL "COFF")
list(APPEND COFF_SDKS ${sdk})
endif()
endforeach()

add_swift_library(swiftImageRegistrationObjectELF
OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE
SwiftRT-ELF.cpp
Expand Down
6 changes: 0 additions & 6 deletions unittests/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}"))

set(swift_runtime_test_extra_libraries)
if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
list(APPEND swift_runtime_test_extra_libraries swiftImageInspectionShared)
endif()

add_subdirectory(LongTests)

set(PLATFORM_SOURCES)
Expand Down Expand Up @@ -59,7 +54,6 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
PRIVATE
swiftCore${SWIFT_PRIMARY_VARIANT_SUFFIX}
${PLATFORM_TARGET_LINK_LIBRARIES}
${swift_runtime_test_extra_libraries}
)
endif()

1 change: 0 additions & 1 deletion utils/gen-static-stdlib-link-args
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function write_linkfile {
-latomic
-lswiftCore
-latomic
-lswiftImageInspectionShared
$ICU_LIBS
-Xlinker
-export-dynamic
Expand Down
1 change: 0 additions & 1 deletion utils/static-executable-args.lnk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-static
-lswiftCore
-lswiftImageInspectionShared
-Xlinker
--defsym=__import_pthread_self=pthread_self
-Xlinker
Expand Down