|
13 | 13 | import SWBUtil |
14 | 14 | import SWBMacro |
15 | 15 |
|
16 | | -/// Spec to use the linker to run `ld -r` to create a prelinked object file. |
17 | | -public final class PrelinkedObjectLinkSpec: CommandLineToolSpec, SpecImplementationType, @unchecked Sendable { |
18 | | - public static let identifier = "com.apple.build-tools.prelinked-object-link" |
| 16 | +/// Spec to use the linker to run `ld -r` to create a prelinked object file (a.k.a. "master object file"). |
| 17 | +final class MasterObjectLinkSpec: CommandLineToolSpec, SpecImplementationType, @unchecked Sendable { |
| 18 | + static let identifier = "com.apple.build-tools.master-object-link" |
19 | 19 |
|
20 | | - public class func construct(registry: SpecRegistry, proxy: SpecProxy) -> Spec { |
21 | | - return PrelinkedObjectLinkSpec(registry, proxy, ruleInfoTemplate: [], commandLineTemplate: []) |
| 20 | + class func construct(registry: SpecRegistry, proxy: SpecProxy) -> Spec { |
| 21 | + return MasterObjectLinkSpec(registry, proxy, ruleInfoTemplate: [], commandLineTemplate: []) |
22 | 22 | } |
23 | 23 |
|
24 | | - public override func constructTasks(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate) async { |
| 24 | + override func constructTasks(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate) async { |
25 | 25 | guard let toolSpecInfo = await cbc.producer.ldLinkerSpec.discoveredCommandLineToolSpecInfo(cbc.producer, cbc.scope, delegate) as? DiscoveredLdLinkerToolSpecInfo else { |
26 | 26 | delegate.error("Could not find path to ld binary") |
27 | 27 | return |
@@ -62,14 +62,14 @@ public final class PrelinkedObjectLinkSpec: CommandLineToolSpec, SpecImplementat |
62 | 62 | commandLine += cbc.scope.evaluate(BuiltinMacros.PRELINK_FLAGS) |
63 | 63 | let warningLdFlags = cbc.scope.evaluate(BuiltinMacros.WARNING_LDFLAGS) |
64 | 64 | if !warningLdFlags.isEmpty { |
65 | | - // WARNING_LDFLAGS for some reason is only used for creating the prelinked object file. |
| 65 | + // WARNING_LDFLAGS for some reason is only used for creating the master object file. |
66 | 66 | delegate.warning("WARNING_LDFLAGS is deprecated; use OTHER_LDFLAGS instead.", location: .buildSetting(BuiltinMacros.WARNING_LDFLAGS)) |
67 | 67 | commandLine += warningLdFlags |
68 | 68 | } |
69 | 69 | commandLine += cbc.inputs.map({ $0.absolutePath.str }) |
70 | 70 | commandLine += cbc.scope.evaluate(BuiltinMacros.PRELINK_LIBS) |
71 | 71 | commandLine += ["-o", outputPath.str] |
72 | 72 |
|
73 | | - delegate.createTask(type: self, ruleInfo: ["PrelinkedObjectLink", outputPath.str], commandLine: commandLine, environment: EnvironmentBindings(), workingDirectory: cbc.producer.defaultWorkingDirectory, inputs: cbc.inputs.map({ $0.absolutePath }), outputs: [outputPath], action: nil, execDescription: "Link \(outputPath.basename)", enableSandboxing: enableSandboxing) |
| 73 | + delegate.createTask(type: self, ruleInfo: ["MasterObjectLink", outputPath.str], commandLine: commandLine, environment: EnvironmentBindings(), workingDirectory: cbc.producer.defaultWorkingDirectory, inputs: cbc.inputs.map({ $0.absolutePath }), outputs: [outputPath], action: nil, execDescription: "Link \(outputPath.basename)", enableSandboxing: enableSandboxing) |
74 | 74 | } |
75 | 75 | } |
0 commit comments