AArch64 redefines these four flags so they don't match between architectures. This is what was actually causing ls to fail, the x86 side was passing in O_DIRECTORY which the AArch64 side was interpreting at O_DIRECT. This made it return EINVAL