You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ignore -no_exported_symbols when the debug dylib is used (rdar://152244838) (#554)
The stub executor needs to trampoline to the entry point in the debug dylib. But linking with `-no_exported_symbols` strips it and launching the app fails to find the symbol.
Handles both the `LD_EXPORT_SYMBOLS` build setting and manual flags added to `OTHER_LDFLAGS`.
Copy file name to clipboardExpand all lines: Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift
+29-1Lines changed: 29 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -314,6 +314,8 @@ public final class LdLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @unchec
314
314
delegate.emit(Diagnostic(behavior: dyldEnvDiagnosticBehavior, location:.buildSetting(BuiltinMacros.OTHER_LDFLAGS), data:DiagnosticData("The \(BuiltinMacros.OTHER_LDFLAGS.name) build setting is not allowed to contain \(arg), use the dedicated LD_ENVIRONMENT build setting instead.")))
315
315
case"-client_name":
316
316
delegate.emit(Diagnostic(behavior: dyldEnvDiagnosticBehavior, location:.buildSetting(BuiltinMacros.OTHER_LDFLAGS), data:DiagnosticData("The \(BuiltinMacros.OTHER_LDFLAGS.name) build setting is not allowed to contain \(arg), use the dedicated LD_CLIENT_NAME build setting instead.")))
317
+
case"-no_exported_symbols":
318
+
delegate.emit(Diagnostic(behavior: dyldEnvDiagnosticBehavior, location:.buildSetting(BuiltinMacros.OTHER_LDFLAGS), data:DiagnosticData("The \(BuiltinMacros.OTHER_LDFLAGS.name) build setting is not allowed to contain \(arg), use the dedicated LD_EXPORT_SYMBOLS build setting instead.")))
317
319
default:
318
320
break
319
321
}
@@ -504,6 +506,15 @@ public final class LdLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @unchec
/// Test that the `__info_plist` section ends up in the stub executor instead of the preview dylib when `CREATE_INFOPLIST_SECTION_IN_BINARY` is enabled.
results.checkWarning(.equal("The OTHER_LDFLAGS build setting is not allowed to contain -dyld_env, use the dedicated LD_ENVIRONMENT build setting instead. (in target 'Tool' from project 'ProjectName')"))
1116
1124
results.checkWarning(.equal("The OTHER_LDFLAGS build setting is not allowed to contain -dyld_env, use the dedicated LD_ENVIRONMENT build setting instead. (in target 'Tool' from project 'ProjectName')"))
1125
+
results.checkWarning(.equal("The OTHER_LDFLAGS build setting is not allowed to contain -no_exported_symbols, use the dedicated LD_EXPORT_SYMBOLS build setting instead. (in target 'Tool' from project 'ProjectName')"))
1126
+
results.checkWarning(.equal("The OTHER_LDFLAGS build setting is not allowed to contain -no_exported_symbols, use the dedicated LD_EXPORT_SYMBOLS build setting instead. (in target 'Tool' from project 'ProjectName')"))
0 commit comments