Skip to content

Commit cb3828e

Browse files
author
Eugene Burmako
authored
Merge pull request swiftlang#25599 from apple/tensorflow-merge
Merging swift-DEVELOPMENT-SNAPSHOT-2019-06-17-a into tensorflow
2 parents 766a1de + ca81f31 commit cb3828e

File tree

352 files changed

+15657
-5507
lines changed

Some content is hidden

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

352 files changed

+15657
-5507
lines changed

CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -862,14 +862,18 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT CMAKE_CROSSCOMPILING)
862862
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
863863
endif()
864864

865-
message(STATUS "Building host Swift tools for ${SWIFT_HOST_VARIANT_SDK} ${SWIFT_HOST_VARIANT_ARCH}")
866-
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
867-
message(STATUS " Assertions: ${LLVM_ENABLE_ASSERTIONS}")
868-
message(STATUS " LTO: ${SWIFT_TOOLS_ENABLE_LTO}")
869-
message(STATUS "")
870-
871-
if (SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
865+
if(SWIFT_INCLUDE_TOOLS)
866+
message(STATUS "Building host Swift tools for ${SWIFT_HOST_VARIANT_SDK} ${SWIFT_HOST_VARIANT_ARCH}")
867+
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
868+
message(STATUS " Assertions: ${LLVM_ENABLE_ASSERTIONS}")
869+
message(STATUS " LTO: ${SWIFT_TOOLS_ENABLE_LTO}")
870+
message(STATUS "")
871+
else()
872+
message(STATUS "Not building host Swift tools")
873+
message(STATUS "")
874+
endif()
872875

876+
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
873877
message(STATUS "Building Swift standard library and overlays for SDKs: ${SWIFT_SDKS}")
874878
message(STATUS " Build type: ${SWIFT_STDLIB_BUILD_TYPE}")
875879
message(STATUS " Assertions: ${SWIFT_STDLIB_ASSERTIONS}")
@@ -878,12 +882,9 @@ if (SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
878882
message(STATUS "Building Swift runtime with:")
879883
message(STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER}")
880884
message(STATUS "")
881-
882885
else()
883-
884886
message(STATUS "Not building Swift standard library, SDK overlays, and runtime")
885887
message(STATUS "")
886-
887888
endif()
888889

889890
#

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Additionally, [Bazel](https://www.bazel.build) between v0.24.1 and v0.25.2 (incl
4949

5050
For Ubuntu, you'll need the following development dependencies:
5151

52-
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync
52+
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync
5353

5454
Additionally, [Bazel](https://www.bazel.build) between v0.24.1 and v0.25.2 (inclusive) is required to build with TensorFlow support. Ubuntu installation instructions can be found [below](#bazel).
5555

cmake/modules/AddSwift.cmake

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,10 @@ function(_add_variant_link_flags)
462462
list(APPEND link_libraries "bsd" "atomic")
463463
list(APPEND result "-Wl,-Bsymbolic")
464464
elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
465-
list(APPEND link_libraries "dl" "log" "atomic" "icudataswift" "icui18nswift" "icuucswift")
466-
# We provide our own C++ below, so we ask the linker not to do it. However,
467-
# we need to add the math library, which is linked implicitly by libc++.
468-
list(APPEND result "-nostdlib++" "-lm")
465+
list(APPEND link_libraries "dl" "log" "atomic")
466+
# We need to add the math library, which is linked implicitly by libc++
467+
list(APPEND result "-lm")
468+
469469
if("${LFLAGS_ARCH}" MATCHES armv7)
470470
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a")
471471
elseif("${LFLAGS_ARCH}" MATCHES aarch64)
@@ -477,8 +477,17 @@ function(_add_variant_link_flags)
477477
else()
478478
message(SEND_ERROR "unknown architecture (${LFLAGS_ARCH}) for android")
479479
endif()
480-
list(APPEND link_libraries "${android_libcxx_path}/libc++abi.a")
481-
list(APPEND link_libraries "${android_libcxx_path}/libc++_shared.so")
480+
481+
# link against the custom C++ library
482+
list(APPEND link_libraries
483+
${android_libcxx_path}/libc++abi.a
484+
${android_libcxx_path}/libc++_shared.so)
485+
486+
# link against the ICU libraries
487+
list(APPEND link_libraries
488+
${SWIFT_ANDROID_${LFLAGS_ARCH}_ICU_I18N}
489+
${SWIFT_ANDROID_${LFLAGS_ARCH}_ICU_UC})
490+
482491
swift_android_lib_for_arch(${LFLAGS_ARCH} ${LFLAGS_ARCH}_LIB)
483492
foreach(path IN LISTS ${LFLAGS_ARCH}_LIB)
484493
list(APPEND library_search_directories ${path})
@@ -517,8 +526,12 @@ function(_add_variant_link_flags)
517526
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
518527
list(APPEND result "-fuse-ld=lld")
519528
elseif(SWIFT_ENABLE_GOLD_LINKER AND
520-
"${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
521-
list(APPEND result "-fuse-ld=gold")
529+
"${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
530+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
531+
list(APPEND result "-fuse-ld=gold.exe")
532+
else()
533+
list(APPEND result "-fuse-ld=gold")
534+
endif()
522535
endif()
523536
endif()
524537

@@ -1400,8 +1413,16 @@ function(_add_swift_library_single target name)
14001413
${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
14011414
endif()
14021415

1403-
set_property(TARGET "${target}" PROPERTY
1416+
# NOTE(compnerd) use the C linker language to invoke `clang` rather than
1417+
# `clang++` as we explicitly link against the C++ runtime. We were previously
1418+
# actually passing `-nostdlib++` to avoid the C++ runtime linkage.
1419+
if(SWIFTLIB_SINGLE_SDK STREQUAL ANDROID)
1420+
set_property(TARGET "${target}" PROPERTY
1421+
LINKER_LANGUAGE "C")
1422+
else()
1423+
set_property(TARGET "${target}" PROPERTY
14041424
LINKER_LANGUAGE "CXX")
1425+
endif()
14051426

14061427
if(target_static)
14071428
set_property(TARGET "${target_static}" APPEND_STRING PROPERTY

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function(_report_sdk prefix)
2828
message(STATUS " ${arch} LIB: ${${arch}_LIB}")
2929
endforeach()
3030
elseif("${prefix}" STREQUAL "ANDROID")
31-
message(STATUS " NDK Dir: $ENV{SWIFT_ANDROID_NDK_PATH}")
31+
message(STATUS " NDK: $ENV{SWIFT_ANDROID_NDK_PATH}")
3232
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
3333
swift_android_include_for_arch(${arch} ${arch}_INCLUDE)
3434
swift_android_lib_for_arch(${arch} ${arch}_LIB)
@@ -225,10 +225,14 @@ macro(configure_sdk_unix name architectures)
225225
endif()
226226

227227
# Get the prebuilt suffix to create the correct toolchain path when using the NDK
228-
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin")
229-
set(_swift_android_prebuilt_build "darwin-x86_64")
230-
elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
231-
set(_swift_android_prebuilt_build "linux-x86_64")
228+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
229+
set(_swift_android_prebuilt_build darwin-x86_64)
230+
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Linux)
231+
set(_swift_android_prebuilt_build linux-x86_64)
232+
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
233+
set(_swift_android_prebuilt_build Windows-x86_64)
234+
else()
235+
message(SEND_ERROR "cannot cross-compile to android from ${CMAKE_HOST_SYSTEM_NAME}")
232236
endif()
233237
if("${arch}" STREQUAL "i686")
234238
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH

docs/ABI/Mangling.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ Types
512512
FUNCTION-KIND ::= 'U' // uncurried function type (currently not used)
513513
FUNCTION-KIND ::= 'K' // @auto_closure function type (noescape)
514514
FUNCTION-KIND ::= 'B' // objc block function type
515+
FUNCTION-KIND ::= 'L' // objc block function type (escaping) (DWARF only; otherwise use 'B')
515516
FUNCTION-KIND ::= 'C' // C function pointer type
516517
FUNCTION-KIND ::= 'A' // @auto_closure function type (escaping)
517518
FUNCTION-KIND ::= 'E' // function type (noescape)

docs/WindowsBuild.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ cmake -G Ninja^
355355
-DFOUNDATION_BUILD_DIR=S:\b\foundation^
356356
-DLIBDISPATCH_BUILD_DIR=S:\b\libdispatch^
357357
-DLIBDISPATCH_SOURCE_DIR=S:\swift-corelibs-libdispatch^
358-
-DLLBUILD_PATH_TO_SQLITE_SOURCE=S:\sqlite-amalgamation-3270200^
359-
-DLLBUILD_PATH_TO_SQLITE_BUILD=S:\b\sqlite^
358+
-DSQLite3_INCLUDE_DIR=S:\sqlite-amalgamation-3270200^
359+
-DSQLite3_LIBRARY=S:\b\sqlite\sqlite3.lib^
360360
-DLLBUILD_SUPPORT_BINDINGS=Swift^
361361
S:\llbuild
362362
ninja

0 commit comments

Comments
 (0)