I’m having a problem. I have compiled couchbase lite core on a Mac OSX 10.13 system, but it crashes when executed on systems with 10.10 and 10.11 because the symbol _kdebug_signpost_start doesn’t exist. Is there any way of avoiding the link with the _kdebug_signpost_start? Stack trace below.
Symbol not found: _kdebug_signpost_start
Expected in: /usr/lib/libSystem.B.dylib
Signposts were added in macOS 10.12. A quick scan of the code shows you might be able to undefine LITECORE_SIGNPOSTS in LiteCore/Support/Instrumentation.hh
Signposts exist only for profiling, and have no effect on the actual library functionality. You won’t notice a difference with them gone unless you are profiling inside of Xcode instruments.
Our calls to the signpost API and dispatch_queue_attr_make_with_autorelease_frequency are conditionalized with __builtin_available, and we’ve set the macOS deployment target to 10.11, so I don’t understand why there’d be any runtime problem on 10.10.
What I have done to build couchbase-lite-core was simply calling the build_macos.sh script without any kind of parameters. Those calls are protected with: if (__builtin_available(macOS 10.12, iOS 10, tvOS 10)) but they are definitely being included as I have built this on a Mac OS 10.13 system. I had to comment in four different places:
a) LiteCore/Support/Instrumentation.hh - #define LITECORE_SIGNPOSTS 0
b) LiteCore/Support/FilePath.cc
c) vendor/BLIP-Cpp/src/util/Codec.cc
d) vendor/BLIP-Cpp/src/util/GCDMailbox.cc
I would prefer to not hack the files everytime I need to rebuild couchbase-lite-core.
Is there any way of specifying the target deployment system?
Edit Project.xcconfig (there’s one in LiteCore and one in vendor/BLIP_Cpp) and change MACOSX_DEPLOYMENT_TARGET. But it’s already set to 10.11, so I don’t know why the binary is non-weak linking against symbols added in 10.12.