I'm running macOS 10.15. I compiled my binary fine here and sent it to sb else with an older macOS version.
He keeps getting the following error:
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /Users/nkszf/Documents/./testapp (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ____chkstk_darwin
Referenced from: /Users/nkszf/Documents/./testapp (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
SIGABRT: Abnormal termination.
What is going on? Is there any way to cross-compile it and make it work?
This is my current nim command:
nim c -d:release -d:danger --panics:on --gc:arc --checks:off -d:ssl --opt:speed --passC:"-O3 -flto" --passL:"-flto" --nimcache:.cache --embedsrc:on --path:src -o:myapp src/main.nim
No, Apple's toolchain has pretty comprehensive support for specifying the degree of backward compatibility you want — the "Deployment version" in its terminology. The program will then only use system symbols available in that OS version.
There are some environment variables you need to set when running the C compiler. I'm not very clear on this because I almost always build with the Xcode IDE, but it looks as though setting MACOSX_DEPLOYMENT_TARGET to e.g. 10.12 would do it.