Standalone build steps for Android

86 views
Skip to first unread message

Brian Gore

unread,
Apr 2, 2020, 3:27:26 PM4/2/20
to google-breakpad-discuss
I'm trying to the client library with the steps under "I.2. Building with a standalone Android toolchain:", from https://github.com/google/breakpad/blob/master/README.ANDROID, but the build (make) fails with numerous errors.
I'm getting 'unknown types' and 'undeclared identifiers' from missing headers, it appears.  Given the output, I think I have toolchain problem, but don't know how to fix it.  Any (detailed) steps would be appreciated.

I'm performing the build from MacOS terminal with Android NDK r20b installed (min SDK 21).  I ran:
  ./configure --host=aarch64-linux-android --disable-processor --disable-tools
then:
  make

Output follows:
depbase=`echo src/client/linux/crash_generation/crash_generation_client.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    g++ -DHAVE_CONFIG_H -I. -I./src  -I./src  -I./src/common/android/include -I./src/common/android/testing/include -Wmissing-braces -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-compare -Wunused-local-typedefs -Wunused-variable -Wvla -Werror -fPIC -g -O2 -std=c++11 -MT src/client/linux/crash_generation/crash_generation_client.o -MD -MP -MF $depbase.Tpo -c -o src/client/linux/crash_generation/crash_generation_client.o src/client/linux/crash_generation/crash_generation_client.cc &&\
    mv -f $depbase.Tpo $depbase.Po
In file included from src/client/linux/crash_generation/crash_generation_client.cc:36:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:644:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:654:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:86:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:66:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/wait.h:109:
In file included from ./src/common/android/include/sys/signal.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:69:42: error: use of
      undeclared identifier 'NSIG'
extern __const char *__const sys_signame[NSIG];
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:70:42: error: use of
      undeclared identifier 'NSIG'
extern __const char *__const sys_siglist[NSIG];
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:83:32: error: unknown type
      name 'sigset_t'
int     pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:83:44: error: unknown type
      name 'sigset_t'
int     pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);
                                               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:86:15: error: unknown type
      name 'sigset_t'
int     sigaddset(sigset_t *, int);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:87:23: error: unknown type
      name 'stack_t'
int     sigaltstack(const stack_t * __restrict, stack_t * __restrict)  __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:87:45: error: unknown type
      name 'stack_t'
int     sigaltstack(const stack_t * __restrict, stack_t * __restrict)  __DARWIN_ALIAS(sigaltstack) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
                                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:88:15: error: unknown type
      name 'sigset_t'
int     sigdelset(sigset_t *, int);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:89:17: error: unknown type
      name 'sigset_t'
int     sigemptyset(sigset_t *);
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:90:16: error: unknown type
      name 'sigset_t'
int     sigfillset(sigset_t *);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:94:23: error: unknown type
      name 'sigset_t'
int     sigismember(const sigset_t *, int);
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:96:16: error: unknown type
      name 'sigset_t'
int     sigpending(sigset_t *);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:97:28: error: unknown type
      name 'sigset_t'
int     sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
                               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:97:51: error: unknown type
      name 'sigset_t'
int     sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
                                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:100:22: error: unknown type
      name 'sigset_t'
int     sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend);
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:101:19: error: unknown type
      name 'sigset_t'
int     sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/signal.h:116:22: error: use of
      undeclared identifier '__DARWIN_NSIG'
    return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1));
                     ^
In file included from src/client/linux/crash_generation/crash_generation_client.cc:36:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:644:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:654:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/typeinfo:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:86:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:66:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/wait.h:251:32: error: unknown
      type name 'siginfo_t'
int     waitid(idtype_t, id_t, siginfo_t *, int) __DARWIN_ALIAS_C(waitid);
                               ^
src/client/linux/crash_generation/crash_generation_client.cc:53:9: error: use of undeclared identifier 'sys_pipe'
    if (sys_pipe(fds) < 0)
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [src/client/linux/crash_generation/crash_generation_client.o] Error 1

Brian Gore

unread,
Apr 5, 2020, 9:43:34 AM4/5/20
to google-breakpad-discuss
Resolved: Figured out how to run $NDK/build/tool/make-standalone-toolchain.sh to build and install for my target (--host=aarch64-linux.android).  Then added bin path (~/toolchain/aarch64-linux-android/bin) to PATH and that got the libbreakpad_client.a built.
Reply all
Reply to author
Forward
0 new messages