Skip to content

[pull] swiftwasm-release/5.3 from release/5.3 #295

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 4 commits into from
Sep 21, 2020
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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ if ProcessInfo.processInfo.environment["SWIFTPM_LLBUILD_FWK"] == nil {

if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
package.dependencies += [
.package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("master")),
.package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("release/5.3")),
]
} else {
package.dependencies += [
Expand Down
4 changes: 2 additions & 2 deletions Sources/Build/BuildPlan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1042,11 +1042,11 @@ public final class ProductBuildDescription {
}
case .executable:
// Link the Swift stdlib statically, if requested.
//
// FIXME: This does not work for linux yet (SR-648).
if buildParameters.shouldLinkStaticSwiftStdlib {
if buildParameters.triple.isDarwin() {
diagnostics.emit(.swiftBackDeployError)
} else if buildParameters.triple.isLinux() {
args += ["-static-stdlib"]
}
}
args += ["-emit-executable"]
Expand Down
2 changes: 2 additions & 0 deletions Sources/PackageDescription/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ foreach(PACKAGE_DESCRIPTION_VERSION 4 4_2)
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(PD${PACKAGE_DESCRIPTION_VERSION} PRIVATE
Foundation)
target_link_options(PD${PACKAGE_DESCRIPTION_VERSION} PRIVATE
"SHELL:-no-toolchain-stdlib-rpath")
endif()

if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
Expand Down
4 changes: 2 additions & 2 deletions Sources/PackageLoading/PackageBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,12 @@ public final class PackageBuilder {
func buildConditions(from condition: PackageConditionDescription?) -> [PackageConditionProtocol] {
var conditions: [PackageConditionProtocol] = []

if let config = condition?.config.map({ BuildConfiguration(rawValue: $0)! }) {
if let config = condition?.config.flatMap({ BuildConfiguration(rawValue: $0) }) {
let condition = ConfigurationCondition(configuration: config)
conditions.append(condition)
}

if let platforms = condition?.platformNames.map({ platformRegistry.platformByName[$0]! }), !platforms.isEmpty {
if let platforms = condition?.platformNames.flatMap({ platformRegistry.platformByName[$0] }), !platforms.isEmpty {
let condition = PlatformsCondition(platforms: platforms)
conditions.append(condition)
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/BuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ final class BuildPlanTests: XCTestCase {
let linkArguments = [
"/fake/path/to/swiftc", "-L", "/path/to/build/debug",
"-o", "/path/to/build/debug/exe", "-module-name", "exe",
"-emit-executable",
"-static-stdlib", "-emit-executable",
"-Xlinker", "-rpath=$ORIGIN",
"@/path/to/build/debug/exe.product/Objects.LinkFileList",
"-target", defaultTargetTriple,
Expand Down
5 changes: 5 additions & 0 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ def get_swiftpm_flags(args):
elif cross_compile_hosts:
error("cannot cross-compile for %s" % cross_compile_hosts)

# On ELF platforms, remove the host toolchain's stdlib absolute rpath from
# installed executables and shared libraries.
if platform.system() != "Darwin" and args.command == 'install':
build_flags.extend(["-Xswiftc", "-no-toolchain-stdlib-rpath"])

return build_flags

if __name__ == '__main__':
Expand Down