I've updated my M1 mac to Monterey and installed Xcode 13.1. I have a shared lib project I compile with -nostdlib.
It's a CPU emulator that doesn't use any external code, no system calls, no std c lib functions... nothing. The library doesn't require initialization either.
Now I get this error when building the library
ld: dynamic main executables must link with libSystem.dylib for architecture arm64
which can be solved by passing -lSystem
to the linker.
The question is: is this a bug? I've not changed anything in my project. Is this a new Apple policy? to force everything to be linked against libSystem even when it's not necessary?