Skip to content

Commit 37ed5e5

Browse files
zhuoweikateinoigakukun
authored andcommitted
WebAssembly: compile ImageInspectionELF for WebAssembly for now
1 parent 5e5c605 commit 37ed5e5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

stdlib/public/runtime/ImageInspectionELF.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
///
1919
//===----------------------------------------------------------------------===//
2020

21-
#if defined(__ELF__)
21+
#if defined(__ELF__) || defined(__wasm__)
2222

2323
#include "ImageInspection.h"
2424
#include "ImageInspectionELF.h"
25+
#ifndef __wasm__
2526
#include <dlfcn.h>
27+
#endif
2628

2729
using namespace swift;
2830

@@ -132,6 +134,7 @@ void swift_addNewDSOImage(const void *addr) {
132134
}
133135

134136
int swift::lookupSymbol(const void *address, SymbolInfo *info) {
137+
#ifndef __wasm__
135138
Dl_info dlinfo;
136139
if (dladdr(address, &dlinfo) == 0) {
137140
return 0;
@@ -142,6 +145,9 @@ int swift::lookupSymbol(const void *address, SymbolInfo *info) {
142145
info->symbolName.reset(dlinfo.dli_sname);
143146
info->symbolAddress = dlinfo.dli_saddr;
144147
return 1;
148+
#else
149+
return 0;
150+
#endif
145151
}
146152

147153
// This is only used for backward deployment hooks, which we currently only support for

0 commit comments

Comments
 (0)