The WASI docs allow for fewer rights to be applied to an fd than requested but not more. This behavior is also asserted in the rust WASI tests, so it's necessary for those to pass as well.
When building for multiple architectures on OSX, it's necessary to use compiler macros to conditionally include architecture-specific code rather than conditionally including architecture-specific assembly files via cmake. See https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary and https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html for more details. Co-authored-by: Zoraaver Singh <zoraaver@amazon.co.uk>