Skip to content

Conversation

@kateinoigakukun
Copy link
Contributor

I'm creating a wamr binding library for Swift and I faced the following errors

$ swift build --target wamr-demo
./wamr-swift/Sources/wamr-core-darwin/wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:2100:40: error: no member named 'st_atsim' in 'struct stat'
      .st_atim = convert_timespec(&in->st_atsim),
                                   ~~  ^
./wamr-swift/Sources/wamr-core-darwin/wamr/core/iwasm/libraries/libc-wasi/: error: no member named 'st_mtim' in 'struct stat'
      .st_mtim = convert_timespec(&in->st_mtim),
                                   ~~  ^
./wamr-swift/Sources/wamr-core-darwin/wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c:2102:40: error: no member named 'st_ctim' in 'struct stat'
      .st_ctim = convert_timespec(&in->st_ctim),

These no member errors are only reproducible when building with -fmodule because darwin doesn't support POSIX compatible stat fields when -fmodule. So I added macros for platform compatibility.

Darwin doesn't support POSIX compatible stat fields when -fmodule
@wenyongh wenyongh merged commit a229487 into bytecodealliance:main Dec 21, 2020
@kateinoigakukun
Copy link
Contributor Author

Thanks for quick merge 😄

@kateinoigakukun kateinoigakukun deleted the katei/macos-stat-fields branch December 21, 2020 02:58
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Darwin doesn't support POSIX compatible stat fields when -fmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants