Hello,
the previous thread about using crashpad as a breakpad replacement had some useful hints, but I still cannot get crashpad linked correctly into our application. I also had that problem about _audit_token_to_pid not being defined. Setting the deployment target to 10.7 fixed that but introduced loads of errors about libbase not finding various std::string members. To me, that smells of libc++ - our project is built with -stdlib=libc++ and -std=c++11. So I changed the deployment target to 10.9 to make crashpad use the llvm standard library and passed -Dmac_sdk=10.9. Unfortunately, the linker is now complaining about _audit_token_to_pid again.
The (cleaned) linker call looks like this:
/usr/bin/c++ -mmacosx-version-min=10.9 -stdlib=libc++ -std=c++11
-Wall -Wextra -Wno-unused-parameter -Woverloaded-virtual -std=c++11 -g
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
-Wl,-search_paths_first -Wl,-headerpad_max_install_names -o [...]
-framework Foundation -framework AppKit -framework ApplicationServices
[...]/crashpad/out/Release/libcrashpad_client.a
[...]/crashpad/out/Release/libbase.a
[...]/crashpad/out/Release/libcrashpad_util.a -framework IOKit
-framework Security
Do I need to explicitly tell crashpad to use libc++ or might something else be going wrong here?
Side note:
As we're using cmake, I tried generating a cmake file for crashpad using gyp as I don't really know ninja. Trying to build that I ended up like this:
-- Configuring done
CMake Error at CMakeLists.txt:1003 (add_library):
Cannot find source file:
$(SDKROOT)/usr/include/mach/exc.defs
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error at CMakeLists.txt:335 (add_library):
Cannot find source file:
../../third_party/mini_chromium/mini_chromium/base/base/atomicops.h
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: Cannot determine link language for target "crashpad_util".
CMake Error: CMake can not determine linker language for target: crashpad_util
CMake Error: Cannot determine link language for target "third_party_mini_chromium_mini_chromium_base_base_gyp_base".
CMake Error: CMake can not determine linker language for target: third_party_mini_chromium_mini_chromium_base_base_gyp_base
-- Generating done