@@ -800,16 +800,6 @@ macro(add_swift_lib_subdirectory name)
800
800
add_llvm_subdirectory(SWIFT LIB ${name} )
801
801
endmacro()
802
802
803
- function(_link_built_compatibility_libs executable)
804
- set(platform ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR})
805
- target_link_directories(${executable} PRIVATE
806
- ${SWIFTLIB_DIR} /${platform} )
807
- add_dependencies(${executable}
808
- " swiftCompatibility50-${platform} "
809
- " swiftCompatibility51-${platform} "
810
- " swiftCompatibilityDynamicReplacements-${platform} ")
811
- endfunction()
812
-
813
803
function(add_swift_host_tool executable)
814
804
set(options HAS_LIBSWIFT)
815
805
set(single_parameter_options SWIFT_COMPONENT BOOTSTRAPPING)
@@ -908,24 +898,26 @@ function(add_swift_host_tool executable)
908
898
list(APPEND RPATH_LIST " /usr/lib/swift ")
909
899
910
900
elseif(LIBSWIFT_BUILD_MODE STREQUAL " BOOTSTRAPPING-WITH-HOSTLIBS ")
911
- # Pick up the built libswiftCompatibility<n>.a libraries
912
- _link_built_compatibility_libs(${executable} )
913
-
914
901
# Add the SDK directory for the host platform.
915
902
target_link_directories(${executable} PRIVATE " ${sdk_dir} ")
916
903
904
+ # A backup in case the toolchain doesn't have one of the compatibility libraries.
905
+ target_link_directories(${executable} PRIVATE
906
+ " ${SWIFTLIB_DIR} /${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} ")
907
+
917
908
# Include the abi stable system stdlib in our rpath.
918
909
list(APPEND RPATH_LIST " /usr/lib/swift ")
919
910
920
911
elseif(LIBSWIFT_BUILD_MODE STREQUAL " BOOTSTRAPPING ")
921
- # Pick up the built libswiftCompatibility<n>.a libraries
922
- _link_built_compatibility_libs(${executable} )
923
-
924
912
# At build time link against the built swift libraries from the
925
913
# previous bootstrapping stage.
926
914
get_bootstrapping_swift_lib_dir(bs_lib_dir " ${ASHT_BOOTSTRAPPING} ")
927
915
target_link_directories(${executable} PRIVATE ${bs_lib_dir} )
928
916
917
+ # Required to pick up the built libswiftCompatibility<n>.a libraries
918
+ target_link_directories(${executable} PRIVATE
919
+ " ${SWIFTLIB_DIR} /${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} ")
920
+
929
921
# At runtime link against the built swift libraries from the current
930
922
# bootstrapping stage.
931
923
list(APPEND RPATH_LIST " @executable_path/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} ")
0 commit comments