@@ -67,12 +67,12 @@ struct ABIEntryPointTests {
67
67
passing arguments: __CommandLineArguments_v0 ,
68
68
recordHandler: @escaping @Sendable ( _ recordJSON: UnsafeRawBufferPointer ) -> Void = { _ in }
69
69
) async throws -> Bool {
70
- #if !os(Linux) && ! os(FreeBSD) && ! os(Android) && !SWT_NO_DYNAMIC_LINKING
70
+ #if !( os(Linux) || os(FreeBSD) || os(OpenBSD) || os( Android) ) && !SWT_NO_DYNAMIC_LINKING
71
71
// Get the ABI entry point by dynamically looking it up at runtime.
72
72
//
73
- // NOTE: The standard Linux linker does not allow exporting symbols from
74
- // executables, so dlsym() does not let us find this function on that
75
- // platform when built as an executable rather than a dynamic library.
73
+ // NOTE: The standard linkers on these platforms do not export symbols from
74
+ // executables, so dlsym() does not let us find this function on these
75
+ // platforms when built as an executable rather than a dynamic library.
76
76
let abiv0_getEntryPoint = try withTestingLibraryImageAddress { testingLibrary in
77
77
try #require(
78
78
symbol ( in: testingLibrary, named: " swt_abiv0_getEntryPoint " ) . map {
@@ -187,8 +187,9 @@ private func withTestingLibraryImageAddress<R>(_ body: (ImageAddress?) throws ->
187
187
defer {
188
188
dlclose ( testingLibraryAddress)
189
189
}
190
- #elseif os(Linux) || os(FreeBSD) || os(Android)
191
- // When using glibc, dladdr() is only available if __USE_GNU is specified.
190
+ #elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
191
+ // We can't dynamically look up a function linked into the test executable on
192
+ // ELF-based platforms.
192
193
#elseif os(Windows)
193
194
let flags = DWORD ( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS)
194
195
try addressInTestingLibrary. withMemoryRebound ( to: wchar_t. self, capacity: MemoryLayout < UnsafeRawPointer > . stride / MemoryLayout < wchar_t > . stride) { addressInTestingLibrary in
0 commit comments