Built using Xcode Version 13.1 (13A1030d) on macOS Monterey 12.0.1.
The dylib was built in a release configuration with architectures set to $(ARCHS_STANDARD). This builds a FAT binary with x86_64 and arm64, as expected.
However, when I dlopen it with RTLD_NOW | RTLD_GLOBAL, it fails and dlerror reports "slice is not page aligned" twice, and a message saying that it is looking for x86_64h but only finds x86_64,arm64 is reported.
Not sure what the root cause is, but certainly the slice not being page aligned is causing issues. The question may therefore be: how can I ensure the dylib generated as a FAT binary has its slices aligned in Xcode 13?