Skip to content

Commit 7878ba4

Browse files
committed
---
yaml --- r: 314367 b: refs/heads/master c: 17b917f h: refs/heads/master i: 314365: ba3ea73 314363: d6e0eb2 314359: ac56655 314351: cff0db6 314335: e83c21c 314303: 8d7f6eb 314239: 20049fc 314111: e45cced 313855: f2bafd0 313343: 64a48b2
1 parent ad34bb6 commit 7878ba4

File tree

366 files changed

+4602
-6271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+4602
-6271
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fb2128b33baeb5612c511a52a9fd47f1267502fa
2+
refs/heads/master: 17b917fef9a58125b752d1a2214457fdc0157c69
33
refs/heads/master-next: 66a7e661ff8e88e2d4efab3e430197a7a941e352
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/CMakeLists.txt

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,7 @@ if(SWIFT_HOST_VARIANT_SDK)
603603
set(SWIFT_HOST_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
604604
else()
605605
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
606-
# CMake on an Android host sets this to Linux, so check for the ANDROID_DATA
607-
# environment variable to see if we're building on Android.
608-
if(NOT "$ENV{ANDROID_DATA}" STREQUAL "")
609-
set(SWIFT_HOST_VARIANT_SDK_default "ANDROID")
610-
else()
611-
set(SWIFT_HOST_VARIANT_SDK_default "LINUX")
612-
endif()
606+
set(SWIFT_HOST_VARIANT_SDK_default "LINUX")
613607
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
614608
set(SWIFT_HOST_VARIANT_SDK_default "FREEBSD")
615609
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
@@ -619,7 +613,6 @@ else()
619613
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
620614
set(SWIFT_HOST_VARIANT_SDK_default "HAIKU")
621615
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
622-
# CMAKE_SYSTEM_NAME might be set this way when cross-compiling to Android.
623616
set(SWIFT_HOST_VARIANT_SDK_default "ANDROID")
624617
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
625618
set(SWIFT_HOST_VARIANT_SDK_default "OSX")
@@ -684,7 +677,7 @@ endif()
684677

685678
# FIXME: the parameters we specify in SWIFT_SDKS are lacking architecture specifics,
686679
# so we need to hard-code it. For example, the SDK for Android is just 'ANDROID',
687-
# and we have to specify SWIFT_SDK_ANDROID_ARCHITECTURES separately.
680+
# which we assume below to be armv7.
688681
# The iOS SDKs all have their architectures hardcoded because they are just specified by name (e.g. 'IOS' or 'WATCHOS').
689682
# We can't cross-compile the standard library for another linux architecture,
690683
# because the SDK list would just be 'LINUX' and we couldn't disambiguate it from the host.
@@ -746,16 +739,9 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "HAIKU")
746739
elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "ANDROID")
747740

748741
set(SWIFT_HOST_VARIANT "android" CACHE STRING
749-
"Deployment OS for Swift host tools (the compiler) [android]")
742+
"Deployment OS for Swift host tools (the compiler) [android].")
750743

751-
set(SWIFT_ANDROID_NATIVE_SYSROOT "/data/data/com.termux/files" CACHE STRING
752-
"Path to Android sysroot, default initialized to the Termux app's layout")
753-
754-
if("${SWIFT_SDK_ANDROID_ARCHITECTURES}" STREQUAL "")
755-
set(SWIFT_SDK_ANDROID_ARCHITECTURES ${SWIFT_HOST_VARIANT_ARCH})
756-
endif()
757-
758-
configure_sdk_unix("Android" "${SWIFT_SDK_ANDROID_ARCHITECTURES}")
744+
configure_sdk_unix("Android" "${SWIFT_HOST_VARIANT_ARCH}")
759745
set(SWIFT_PRIMARY_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
760746
set(SWIFT_PRIMARY_VARIANT_ARCH_default "${SWIFT_HOST_VARIANT_ARCH}")
761747

@@ -1083,7 +1069,8 @@ endif()
10831069
#
10841070
# We must include stdlib/ before tools/ because stdlib/CMakeLists.txt
10851071
# declares the swift-stdlib-* set of targets. These targets will then
1086-
# implicitly depend on any targets declared with IS_STDLIB.
1072+
# implicitly depend on any targets declared with IS_STDLIB or
1073+
# TARGET_LIBRARY.
10871074
#
10881075
# One such library that declares IS_STDLIB is SwiftSyntax, living in
10891076
# tools/SwiftSyntax. If we include stdlib/ after tools/,

trunk/README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,6 @@ modules, eliminating the need for headers and the code duplication they entail.
4242

4343
To learn more about the programming language, visit [swift.org](https://swift.org/documentation/).
4444

45-
- [Contributing to Swift](#contributing-to-swift)
46-
- [Getting Started](#getting-started)
47-
- [System Requirements](#system-requirements)
48-
- [Getting Sources for Swift and Related Projects](#getting-sources-for-swift-and-related-projects)
49-
- [Building Swift](#building-swift)
50-
- [Swift Toolchains](#swift-toolchains)
51-
- [Build Failures](#build-failures)
52-
- [Testing Swift](#testing-swift)
53-
- [Learning More](#learning-more)
54-
- [Build Dependencies](#build-dependencies)
55-
5645
## Contributing to Swift
5746

5847
Contributions to Swift are welcomed and encouraged! Please see the
@@ -87,7 +76,7 @@ Please make sure you use Python 2.x. Python 3.x is not supported currently.
8776

8877
#### macOS
8978

90-
To build for macOS, you need [Xcode 11 beta 5](https://developer.apple.com/xcode/downloads/).
79+
To build for macOS, you need [Xcode 11 beta 4](https://developer.apple.com/xcode/downloads/).
9180
The required version of Xcode changes frequently, and is often a beta release.
9281
Check this document or the host information on <https://ci.swift.org> for the
9382
current required version.

trunk/benchmark/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ set(SWIFT_BENCH_MODULES
166166
single-source/StringInterpolation
167167
single-source/StringMatch
168168
single-source/StringRemoveDupes
169-
single-source/StringReplaceSubrange
170169
single-source/StringTests
171170
single-source/StringWalk
172171
single-source/Substring

trunk/benchmark/single-source/StringReplaceSubrange.swift

Lines changed: 0 additions & 75 deletions
This file was deleted.

trunk/benchmark/utils/main.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ import StringEnum
161161
import StringInterpolation
162162
import StringMatch
163163
import StringRemoveDupes
164-
import StringReplaceSubrange
165164
import StringTests
166165
import StringWalk
167166
import Substring
@@ -344,7 +343,6 @@ registerBenchmark(StringInterpolationManySmallSegments)
344343
registerBenchmark(StringMatch)
345344
registerBenchmark(StringNormalization)
346345
registerBenchmark(StringRemoveDupes)
347-
registerBenchmark(StringReplaceSubrange)
348346
registerBenchmark(StringTests)
349347
registerBenchmark(StringWalk)
350348
registerBenchmark(SubstringTest)

trunk/cmake/modules/AddSwift.cmake

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ function(_add_variant_c_compile_link_flags)
140140
# lld can handle targeting the android build. However, if lld is not
141141
# enabled, then fallback to the linker included in the android NDK.
142142
if(NOT SWIFT_ENABLE_LLD_LINKER)
143-
swift_android_tools_path(${CFLAGS_ARCH} tools_path)
144-
list(APPEND result "-B" "${tools_path}")
143+
list(APPEND result "-B" "${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_PREBUILT_PATH}/${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_TRIPLE}/bin")
145144
endif()
146145
endif()
147146

@@ -483,9 +482,22 @@ function(_add_variant_link_flags)
483482
# We need to add the math library, which is linked implicitly by libc++
484483
list(APPEND result "-lm")
485484

485+
if("${LFLAGS_ARCH}" MATCHES armv7)
486+
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a")
487+
elseif("${LFLAGS_ARCH}" MATCHES aarch64)
488+
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a")
489+
elseif("${LFLAGS_ARCH}" MATCHES i686)
490+
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/x86")
491+
elseif("${LFLAGS_ARCH}" MATCHES x86_64)
492+
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/x86_64")
493+
else()
494+
message(SEND_ERROR "unknown architecture (${LFLAGS_ARCH}) for android")
495+
endif()
496+
486497
# link against the custom C++ library
487-
swift_android_cxx_libraries_for_arch(${LFLAGS_ARCH} cxx_link_libraries)
488-
list(APPEND link_libraries ${cxx_link_libraries})
498+
list(APPEND link_libraries
499+
${android_libcxx_path}/libc++abi.a
500+
${android_libcxx_path}/libc++_shared.so)
489501

490502
# link against the ICU libraries
491503
list(APPEND link_libraries
@@ -993,7 +1005,7 @@ function(_add_swift_library_single target name)
9931005
${SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES})
9941006
if(("${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "ELF" OR
9951007
"${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "COFF") AND
996-
SWIFTLIB_SINGLE_TARGET_LIBRARY)
1008+
SWIFTLIB_TARGET_LIBRARY)
9971009
if("${libkind}" STREQUAL "SHARED" AND NOT SWIFTLIB_SINGLE_NOSWIFTRT)
9981010
# TODO(compnerd) switch to the generator expression when cmake is upgraded
9991011
# to a version which supports it.
@@ -1092,7 +1104,7 @@ function(_add_swift_library_single target name)
10921104
set_target_properties("${target}"
10931105
PROPERTIES
10941106
INSTALL_NAME_DIR "${install_name_dir}")
1095-
elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "LINUX")
1107+
elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "LINUX" AND NOT "${SWIFTLIB_SINGLE_SDK}" STREQUAL "ANDROID")
10961108
set_target_properties("${target}"
10971109
PROPERTIES
10981110
INSTALL_RPATH "$ORIGIN:/usr/lib/swift/linux")
@@ -1104,14 +1116,6 @@ function(_add_swift_library_single target name)
11041116
# CMake generates incorrect rule `$SONAME_FLAG $INSTALLNAME_DIR$SONAME` for Android build on macOS cross-compile host.
11051117
# Proper linker flags constructed manually. See below variable `swiftlib_link_flags_all`.
11061118
set_target_properties("${target}" PROPERTIES NO_SONAME TRUE)
1107-
# Only set the install RPATH if cross-compiling the host tools, in which
1108-
# case both the NDK and Sysroot paths must be set.
1109-
if(NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "" AND
1110-
NOT "${SWIFT_ANDROID_NATIVE_SYSROOT}" STREQUAL "")
1111-
set_target_properties("${target}"
1112-
PROPERTIES
1113-
INSTALL_RPATH "$ORIGIN")
1114-
endif()
11151119
endif()
11161120

11171121
set_target_properties("${target}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
@@ -1545,6 +1549,7 @@ endfunction()
15451549
# [INSTALL]
15461550
# [IS_STDLIB]
15471551
# [IS_STDLIB_CORE]
1552+
# [TARGET_LIBRARY]
15481553
# [INSTALL_WITH_SHARED]
15491554
# INSTALL_IN_COMPONENT comp
15501555
# DEPLOYMENT_VERSION_OSX version
@@ -1625,13 +1630,17 @@ endfunction()
16251630
#
16261631
# IS_STDLIB
16271632
# Treat the library as a part of the Swift standard library.
1633+
# IS_STDLIB implies TARGET_LIBRARY.
16281634
#
16291635
# IS_STDLIB_CORE
16301636
# Compile as the Swift standard library core.
16311637
#
16321638
# IS_SDK_OVERLAY
16331639
# Treat the library as a part of the Swift SDK overlay.
1634-
# IS_SDK_OVERLAY implies IS_STDLIB.
1640+
# IS_SDK_OVERLAY implies TARGET_LIBRARY and IS_STDLIB.
1641+
#
1642+
# TARGET_LIBRARY
1643+
# Build library for the target SDKs.
16351644
#
16361645
# INSTALL_IN_COMPONENT comp
16371646
# The Swift installation component that this library belongs to.
@@ -1665,6 +1674,7 @@ function(add_swift_target_library name)
16651674
OBJECT_LIBRARY
16661675
SHARED
16671676
STATIC
1677+
TARGET_LIBRARY
16681678
INSTALL_WITH_SHARED)
16691679
set(SWIFTLIB_single_parameter_options
16701680
DEPLOYMENT_VERSION_IOS
@@ -1693,7 +1703,6 @@ function(add_swift_target_library name)
16931703
SWIFT_COMPILE_FLAGS_OSX
16941704
SWIFT_COMPILE_FLAGS_TVOS
16951705
SWIFT_COMPILE_FLAGS_WATCHOS
1696-
SWIFT_COMPILE_FLAGS_LINUX
16971706
SWIFT_MODULE_DEPENDS
16981707
SWIFT_MODULE_DEPENDS_CYGWIN
16991708
SWIFT_MODULE_DEPENDS_FREEBSD
@@ -1718,11 +1727,18 @@ function(add_swift_target_library name)
17181727
if(SWIFTLIB_IS_SDK_OVERLAY)
17191728
set(SWIFTLIB_HAS_SWIFT_CONTENT TRUE)
17201729
set(SWIFTLIB_IS_STDLIB TRUE)
1730+
set(SWIFTLIB_TARGET_LIBRARY TRUE)
1731+
1732+
# Install to sdk-overlay by default, but don't hardcode it
1733+
if(NOT SWIFTLIB_INSTALL_IN_COMPONENT)
1734+
set(SWIFTLIB_INSTALL_IN_COMPONENT sdk-overlay)
1735+
endif()
17211736
endif()
17221737

17231738
# Standard library is always a target library.
17241739
if(SWIFTLIB_IS_STDLIB)
17251740
set(SWIFTLIB_HAS_SWIFT_CONTENT TRUE)
1741+
set(SWIFTLIB_TARGET_LIBRARY TRUE)
17261742
endif()
17271743

17281744
# If target SDKs are not specified, build for all known SDKs.
@@ -1762,6 +1778,9 @@ function(add_swift_target_library name)
17621778
"Either SHARED, STATIC, or OBJECT_LIBRARY must be specified")
17631779
endif()
17641780

1781+
precondition(SWIFTLIB_TARGET_LIBRARY
1782+
MESSAGE "TARGET_LIBRARY not inferred in add_swift_target_library?!")
1783+
17651784
# In the standard library and overlays, warn about implicit overrides
17661785
# as a reminder to consider when inherited protocols need different
17671786
# behavior for their requirements.
@@ -1842,9 +1861,6 @@ function(add_swift_target_library name)
18421861
elseif(${sdk} STREQUAL WATCHOS OR ${sdk} STREQUAL WATCHOS_SIMULATOR)
18431862
list(APPEND swiftlib_swift_compile_flags_all
18441863
${SWIFTLIB_SWIFT_COMPILE_FLAGS_WATCHOS})
1845-
elseif(${sdk} STREQUAL LINUX)
1846-
list(APPEND swiftlib_swift_compile_flags_all
1847-
${SWIFTLIB_SWIFT_COMPILE_FLAGS_LINUX})
18481864
elseif(${sdk} STREQUAL WINDOWS)
18491865
# FIXME(SR2005) static and shared are not mutually exclusive; however
18501866
# since we do a single build of the sources, this doesn't work for
@@ -1956,7 +1972,6 @@ function(add_swift_target_library name)
19561972
${SWIFTLIB_OBJECT_LIBRARY_keyword}
19571973
${SWIFTLIB_INSTALL_WITH_SHARED_keyword}
19581974
${SWIFTLIB_SOURCES}
1959-
TARGET_LIBRARY
19601975
MODULE_TARGET ${MODULE_VARIANT_NAME}
19611976
SDK ${sdk}
19621977
ARCHITECTURE ${arch}
@@ -1976,6 +1991,7 @@ function(add_swift_target_library name)
19761991
${SWIFTLIB_IS_STDLIB_keyword}
19771992
${SWIFTLIB_IS_STDLIB_CORE_keyword}
19781993
${SWIFTLIB_IS_SDK_OVERLAY_keyword}
1994+
${SWIFTLIB_TARGET_LIBRARY_keyword}
19791995
${SWIFTLIB_FORCE_BUILD_OPTIMIZED_keyword}
19801996
${SWIFTLIB_NOSWIFTRT_keyword}
19811997
DARWIN_INSTALL_NAME_DIR "${SWIFTLIB_DARWIN_INSTALL_NAME_DIR}"

trunk/cmake/modules/AddSwiftUnittests.cmake

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,9 @@ function(add_swift_unittest test_dirname)
4242
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
4343
set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
4444
LINK_FLAGS " -Xlinker -rpath -Xlinker ${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx")
45-
elseif("${SWIFT_HOST_VARIANT}" STREQUAL "android")
46-
swift_android_lib_for_arch(${SWIFT_HOST_VARIANT_ARCH} android_system_libs)
47-
set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_DIRECTORIES
48-
"${android_system_libs}")
49-
set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_LIBRARIES "log")
5045
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
51-
set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_LIBRARIES
52-
"atomic")
46+
set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
47+
LINK_FLAGS " -latomic")
5348
endif()
5449

5550
find_program(LDLLD_PATH "ld.lld")

0 commit comments

Comments
 (0)