Has anyone seen a problem like this? I have a C program
#include stdio.h
char map[0x7fffffff];
int main(void){
printf("!\n");
}
When I compile this from the command line and run it, I get the following message:
dyld: Library not loaded: /usr/lib/libSystem.B.dylib
Referenced from: /Users/td/./a.out
Reason: image not found
Abort trap: 6
If I reduce the size of the array enough (say to 100), or if I malloc the storage, the error goes away and the program runs correctly.
I'm using Xcode 12.4, macOS 11.2.3 on a Mac mini (M1, 2020, 16GB).
cc --version says it's
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: arm64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
C++ behaves the same.