Skip to content

Commit 1e22d1a

Browse files
authored
Fix the "register native with iwasm" stuff for macOS (#1558)
- core/shared/platform/darwin/platform_internal.h: macOS has dlopen - samples/native-lib/README.md: Mention macOS
1 parent 5ddc335 commit 1e22d1a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

core/shared/platform/darwin/platform_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ extern "C" {
4646
#define BH_PLATFORM_DARWIN
4747
#endif
4848

49+
#define BH_HAS_DLFCN 1
50+
4951
/* Stack size of applet threads's native part. */
5052
#define BH_APPLET_PRESERVED_STACK_SIZE (32 * 1024)
5153

samples/native-lib/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,20 @@ will be generated.
4545

4646
## Run workload
4747

48+
### Linux
49+
4850
```bash
4951
cd build
5052
./iwasm --native-lib=libtest_add.so --native-lib=libtest_sqrt.so wasm-app/test.wasm
5153
```
5254

55+
### macOS
56+
57+
```bash
58+
cd build
59+
./iwasm --native-lib=libtest_add.dylib --native-lib=libtest_sqrt.dylib wasm-app/test.wasm
60+
```
61+
5362
The output is:
5463

5564
```bash

0 commit comments

Comments
 (0)