Skip to content

Remove fakeld #26

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

Merged
merged 3 commits into from
Dec 19, 2019
Merged
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
10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,9 @@ endif()
# Should we cross-compile the standard library for WebAssembly (WASI)?
is_sdk_requested(WASI swift_build_wasm)
if(swift_build_wasm AND NOT "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WASI")
#if ("${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
# message(FATAL_ERROR "You must set SWIFT_ANDROID_NDK_PATH to cross-compile the Swift runtime for Android")
#endif()
#if (NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin" OR "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux"))
# message(FATAL_ERROR "A Darwin or Linux host is required to build the Swift runtime for Android")
#endif()

if(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY OR SWIFT_BUILD_DYNAMIC_STDLIB)
message(FATAL_ERROR "Unable to build dynamic overlay/stdlib for WASI. WASM does not support dynamic linking.")
endif()
if("${SWIFT_SDK_WASI_ARCHITECTURES}" STREQUAL "")
set(SWIFT_SDK_WASI_ARCHITECTURES wasm32)
endif()
Expand Down
3 changes: 3 additions & 0 deletions build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export sourcedir=$PWD/..
-DCMAKE_RANLIB='$sourcedir/wasi-sdk/bin/llvm-ranlib' \
" \
--build-stdlib-deployment-targets "wasi-wasm32" \
--build-swift-dynamic-sdk-overlay false \
--build-swift-dynamic-stdlib false \
--build-swift-static-sdk-overlay \
--build-swift-static-stdlib \
--install-destdir="$sourcedir/install" \
--install-prefix="/opt/swiftwasm-sdk" \
Expand Down
3 changes: 2 additions & 1 deletion build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export sourcedir=$PWD/..
" \
--build-stdlib-deployment-targets "wasi-wasm32" \
--build-swift-dynamic-sdk-overlay false \
--build-swift-static-sdk-overlay false \
--build-swift-dynamic-stdlib false \
--build-swift-static-sdk-overlay \
--build-swift-static-stdlib \
--llvm-targets-to-build "X86;WebAssembly" \
--stdlib-deployment-targets "wasi-wasm32" \
Expand Down
10 changes: 7 additions & 3 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,7 @@ function(_add_variant_link_flags)
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
# FIXME: On Apple platforms, find_program needs to look for "ld64.lld"
find_program(LDLLD_PATH "ld.lld")
if("${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "WASM")
list(APPEND result "-fuse-ld=${CMAKE_SOURCE_DIR}/fakeld")
elseif((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE) OR
if((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE) OR
("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
list(APPEND result "-fuse-ld=lld")
Expand Down Expand Up @@ -1320,6 +1318,12 @@ function(_add_swift_library_single target name)
list(APPEND c_compile_flags -D_WINDLL)
endif()
endif()
# Double-check that we're not trying to build a dynamic library for WASM.
if(SWIFTLIB_SINGLE_SDK MATCHES WASM)
if(libkind STREQUAL SHARED)
message(FATAL_ERROR "WASM does not support shared libraries.")
endif()
endif()
_add_variant_link_flags(
SDK "${SWIFTLIB_SINGLE_SDK}"
ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE}"
Expand Down
9 changes: 0 additions & 9 deletions fakeld

This file was deleted.

3 changes: 2 additions & 1 deletion stdlib/private/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if(SWIFT_BUILD_SDK_OVERLAY)

add_subdirectory(OSLog)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list_intersect("${SWIFT_APPLE_PLATFORMS}" "${SWIFT_SDKS}" building_darwin_sdks)
if(building_darwin_sdks)
add_subdirectory(StdlibUnittestFoundationExtras)
if (SWIFT_INCLUDE_TESTS)
add_subdirectory(SwiftReflectionTest)
Expand Down