Skip to content

Commit b9ffe26

Browse files
authored
Stop using mergeable-symbols in embedded (#9246)
This flag is now a no-op and isn't needed after recent changes to the embedded swift linkage model. Fixes: #8653
1 parent 22d5844 commit b9ffe26

File tree

2 files changed

+1
-54
lines changed

2 files changed

+1
-54
lines changed

Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,6 @@ public final class SwiftModuleBuildDescription {
475475
args.append("-enable-batch-mode")
476476
}
477477

478-
// Workaround for https://github.com/swiftlang/swift-package-manager/issues/8648
479-
if self.useMergeableSymbols {
480-
args.append("-Xfrontend")
481-
args.append("-mergeable-symbols")
482-
}
483-
484478
args += ["-serialize-diagnostics"]
485479

486480
args += self.buildParameters.indexStoreArguments(for: self.target)
@@ -1068,12 +1062,6 @@ public final class SwiftModuleBuildDescription {
10681062
return true
10691063
}
10701064
}
1071-
1072-
// Workaround for https://github.com/swiftlang/swift-package-manager/issues/8648
1073-
/// Whether to build Swift code with -Xfrontend -mergeable-symbols.
1074-
package var useMergeableSymbols: Bool {
1075-
return self.isEmbeddedSwift
1076-
}
10771065
}
10781066

10791067
extension SwiftModuleBuildDescription {

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,7 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
21462146
)
21472147
XCTAssertNoDiagnostics(observability.diagnostics)
21482148

2149-
// -Xfrontend -mergeable symbols should be passed with Embedded
2149+
// -wmo should be passed with Embedded
21502150
let result = try await BuildPlanResult(plan: mockBuildPlan(
21512151
graph: graph,
21522152
fileSystem: fs,
@@ -2162,47 +2162,6 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
21622162
XCTAssertNoMatch(aCompileArguments, aCompileArgumentsNegativePattern)
21632163
}
21642164

2165-
// Workaround for: https://github.com/swiftlang/swift-package-manager/issues/8648
2166-
func test_mergeableSymbols_enabledInEmbedded() async throws {
2167-
let Pkg: AbsolutePath = "/Pkg"
2168-
let fs: FileSystem = InMemoryFileSystem(
2169-
emptyFiles:
2170-
Pkg.appending(components: "Sources", "A", "A.swift").pathString
2171-
)
2172-
2173-
let observability = ObservabilitySystem.makeForTesting()
2174-
let graph = try loadModulesGraph(
2175-
fileSystem: fs,
2176-
manifests: [
2177-
Manifest.createRootManifest(
2178-
displayName: "Pkg",
2179-
path: .init(validating: Pkg.pathString),
2180-
targets: [
2181-
TargetDescription(
2182-
name: "A",
2183-
settings: [.init(tool: .swift, kind: .enableExperimentalFeature("Embedded"))]
2184-
),
2185-
]
2186-
),
2187-
],
2188-
observabilityScope: observability.topScope
2189-
)
2190-
XCTAssertNoDiagnostics(observability.diagnostics)
2191-
2192-
// -Xfrontend -mergeable symbols should be passed with Embedded
2193-
let result = try await BuildPlanResult(plan: mockBuildPlan(
2194-
graph: graph,
2195-
fileSystem: fs,
2196-
observabilityScope: observability.topScope
2197-
))
2198-
result.checkTargetsCount(1)
2199-
2200-
// Compile Swift Target
2201-
let aCompileArguments = try result.moduleBuildDescription(for: "A").swift().compileArguments()
2202-
let aCompileArgumentsPattern: [StringPattern] = ["-Xfrontend", "-mergeable-symbols"]
2203-
XCTAssertMatch(aCompileArguments, aCompileArgumentsPattern)
2204-
}
2205-
22062165
func testREPLArguments() async throws {
22072166
let Dep = AbsolutePath("/Dep")
22082167
let fs = InMemoryFileSystem(

0 commit comments

Comments
 (0)