Skip to content

Commit bc15cba

Browse files
committedMay 2, 2019
WebAssembly: compile ImageInspectionELF for WebAssembly for now
1 parent e5a5fb2 commit bc15cba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎stdlib/public/runtime/ImageInspectionELF.cpp

+7-1
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

@@ -127,6 +129,7 @@ void swift_addNewDSOImage(const void *addr) {
127129
}
128130

129131
int swift::lookupSymbol(const void *address, SymbolInfo *info) {
132+
#ifndef __wasm__
130133
Dl_info dlinfo;
131134
if (dladdr(address, &dlinfo) == 0) {
132135
return 0;
@@ -137,6 +140,9 @@ int swift::lookupSymbol(const void *address, SymbolInfo *info) {
137140
info->symbolName.reset(dlinfo.dli_sname);
138141
info->symbolAddress = dlinfo.dli_saddr;
139142
return 1;
143+
#else
144+
return 0;
145+
#endif
140146
}
141147

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

0 commit comments

Comments
 (0)
Please sign in to comment.