mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-08 10:51:16 +00:00
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
This commit is contained in:
parent
5ddc335a7f
commit
1e22d1a9e5
|
@ -46,6 +46,8 @@ extern "C" {
|
||||||
#define BH_PLATFORM_DARWIN
|
#define BH_PLATFORM_DARWIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define BH_HAS_DLFCN 1
|
||||||
|
|
||||||
/* Stack size of applet threads's native part. */
|
/* Stack size of applet threads's native part. */
|
||||||
#define BH_APPLET_PRESERVED_STACK_SIZE (32 * 1024)
|
#define BH_APPLET_PRESERVED_STACK_SIZE (32 * 1024)
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,20 @@ will be generated.
|
||||||
|
|
||||||
## Run workload
|
## Run workload
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd build
|
cd build
|
||||||
./iwasm --native-lib=libtest_add.so --native-lib=libtest_sqrt.so wasm-app/test.wasm
|
./iwasm --native-lib=libtest_add.so --native-lib=libtest_sqrt.so wasm-app/test.wasm
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd build
|
||||||
|
./iwasm --native-lib=libtest_add.dylib --native-lib=libtest_sqrt.dylib wasm-app/test.wasm
|
||||||
|
```
|
||||||
|
|
||||||
The output is:
|
The output is:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Loading…
Reference in New Issue
Block a user