crashpad build for tvOS

149 views
Skip to first unread message

tomek

unread,
Aug 30, 2021, 3:14:57 AM8/30/21
to Crashpad-dev

Hi,
I've posted that question on Chromium-discuss group but then was pointed that there is actually a group dedicated for crashpad dev so I'm reposting it here:

I'm trying to build crashpad for tvOS, I've used iOS setup with little changes
like replacing -mios-version-min flag to -mtvos-version-min or changing sdk from iphoneos to appletvos and sdk platform from iPhoneOS to AppleTVOS, based on that I'm using ./build/ios/setup_ios_gn.py script to generate configs and based on Debug-iphoneos I'm creating Debug-appletvos one then I'm running build command: ninja -c out/Debug-appletvos.
Example compile command after the changes looks like this:
clang++ -MMD -MF obj/util/mach/util.exception_ports.o.d -DZLIB_CONST -DCRASHPAD_ZLIB_SOURCE_SYSTEM -Igen/third_party/crashpad/crashpad -Igen -I../.. -I../../third_party/mini_chromium/mini_chromium -Igen
 -I../../compat/mac -I../../compat/ios -I../../compat/non_win  -Wall -Wendif-labels -Werror -Wextra -Wextra-semi -Wheader-hygiene -Wnewline-eof -Wno-missing-field-initializers -Wno-unused-parameter -Wsi
gn-compare -Wstring-conversion -Wvla -fno-exceptions -fno-rtti -fno-strict-aliasing -fobjc-call-cxx-cdtors -fstack-protector-all -fvisibility-inlines-hidden -fvisibility=hidden -isysroot /Applications/X
code.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.3.sdk -arch arm64 -mtvos-version-min=14.0 -g -Wexit-time-destructors -Wimplicit-fallthrough -std=c++14 -c ../../util/m
ach/exception_ports.cc -o obj/util/mach/util.exception_ports.o

unfortunately it fails with:

../../util/mach/exception_ports.cc:61:30: error: 'task_get_exception_ports' is unavailable: not available on tvOS
there are more similar problems:
'fork' has been explicitly marked unavailable here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
or
error: 'mach_msg' is unavailable: not available on tvOS

I'm aware of that I did some hacking within ios related build files to make it compile for tvos so might be I still need to do something more but I would like to ask if anyone did tried to build crashpad or other project which relies on mini_chromium for tvOS? Do I need to put more focus on build files to make it using some posix implementations or it's just not supported right now?

BTW. I'm working on macOS Big Sur v11.4

Thanks for any hints/advice!
Regards,
tomek/

Justin Cohen

unread,
Aug 31, 2021, 12:06:06 PM8/31/21
to Crashpad-dev, osmial...@gmail.com
Hi tomek,

We haven't looked at porting Crashpad to watchOS or tvOS yet -- in fact, the iOS port isn't complete (there are one or two more pending changes -- see https://crrev.com/c/3087721)

I would imagine all of the mach exception port logic will need to be #ifdef-ed out, since I don't believe those are supported on OS_TV and OS_WATCH.  The remaining logic should work, like signal handling, minidump generation, uploading, etc.  But I haven't tried.

I'd be interesting in extending Crashpad to watch and tv once the iOS port is completed.  If you want to patch in change linked above and hack around locally, I'd be happy to answer any questions you have.

Cheers,
Justin
Reply all
Reply to author
Forward
0 new messages