LibCXX Build errors Android 7.0.0_r1

941 views
Skip to first unread message

Daniel Dawson

unread,
Sep 5, 2016, 11:17:17 AM9/5/16
to Android Building
Hello,

I'm building Android 7.0 when I encountered a string of errors halfway though the build from LibCXX. I'm using Arch Linux and I had no trouble building Android 6. I know I'm missing something obvious:

In file included from external/libcxx/include/vector:264:
external/libcxx/include/__config:248:9: error: unknown type name '__char16_t'
typedef __char16_t char16_t;
        ^
external/libcxx/include/__config:249:9: error: unknown type name '__char32_t'
typedef __char32_t char32_t;
        ^
external/libcxx/include/__config:390:1: error: unknown type name 'namespace'
namespace std {
^
external/libcxx/include/__config:390:14: error: expected ';' after top level declarator
namespace std {
             ^
external/libcxx/include/__config:582:1: error: unknown type name 'template'
template <> struct __static_assert_test<true> {};
^
external/libcxx/include/__config:582:10: error: expected identifier or '('
template <> struct __static_assert_test<true> {};
         ^
external/libcxx/include/__config:583:1: error: unknown type name 'template'
template <unsigned> struct __static_assert_check {};
^
external/libcxx/include/__config:583:10: error: expected identifier or '('
template <unsigned> struct __static_assert_check {};

I'm not sure what is causing this.

Many Thanks,
DD

Colin Cross

unread,
Sep 5, 2016, 9:15:06 PM9/5/16
to android-...@googlegroups.com
Can you provide the full error message, everything from the line that
starts with FAILED: to the beginning of the next command (it will look
like [###/###]).
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Daniel Dawson

unread,
Sep 6, 2016, 10:14:32 AM9/6/16
to Android Building

Thank you for your reply,

I have posted the entire faliure message below. It is a bit long:

 In file included from device/asus/grouper/dumpstate/dumpstate.c:17:
In file included from frameworks/native/cmds/dumpstate/dumpstate.h:48:

In file included from external/libcxx/include/vector:264:
external/libcxx/include/__config:248:9: error: unknown type name '__char16_t'
typedef __char16_t char16_t;
        ^
external/libcxx/include/__config:249:9: error: unknown type name '__char32_t'
typedef __char32_t char32_t;
        ^
external/libcxx/include/__config:390:1: error: unknown type name 'namespace'
namespace std {
^
external/libcxx/include/__config:390:14: error: expected ';' after top level declarator
namespace std {
             ^
external/libcxx/include/__config:582:1: error: unknown type name 'template'
template <> struct __static_assert_test<true> {};
^
external/libcxx/include/__config:582:10: error: expected identifier or '('
template <> struct __static_assert_test<true> {};
         ^
external/libcxx/include/__config:583:1: error: unknown type name 'template'
template <unsigned> struct __static_assert_check {};
^
external/libcxx/include/__config:583:10: error: expected identifier or '('
template <unsigned> struct __static_assert_check {};
         ^
In file included from device/asus/grouper/dumpstate/dumpstate.c:17:
In file included from frameworks/native/cmds/dumpstate/dumpstate.h:48:
In file included from external/libcxx/include/vector:265:
In file included from external/libcxx/include/__bit_reference:15:
In file included from external/libcxx/include/algorithm:624:
In file included from external/libcxx/include/initializer_list:47:
external/libcxx/include/cstddef:44:1: error: unknown type name 'namespace'
_LIBCPP_BEGIN_NAMESPACE_STD
^
external/libcxx/include/__config:386:37: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
                                    ^
In file included from device/asus/grouper/dumpstate/dumpstate.c:17:
In file included from frameworks/native/cmds/dumpstate/dumpstate.h:48:
In file included from external/libcxx/include/vector:265:
In file included from external/libcxx/include/__bit_reference:15:
In file included from external/libcxx/include/algorithm:624:
In file included from external/libcxx/include/initializer_list:47:
external/libcxx/include/cstddef:44:1: error: expected ';' after top level declarator
external/libcxx/include/__config:386:51: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
                                                  ^
In file included from device/asus/grouper/dumpstate/dumpstate.c:17:
In file included from frameworks/native/cmds/dumpstate/dumpstate.h:48:
In file included from external/libcxx/include/vector:265:
In file included from external/libcxx/include/__bit_reference:15:
In file included from external/libcxx/include/algorithm:626:
external/libcxx/include/cstring:67:1: error: unknown type name 'namespace'
_LIBCPP_BEGIN_NAMESPACE_STD
^
external/libcxx/include/__config:386:37: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
                                    ^
In file included from device/asus/grouper/dumpstate/dumpstate.c:17:
In file included from frameworks/native/cmds/dumpstate/dumpstate.h:48:
In file included from external/libcxx/include/vector:265:
In file included from external/libcxx/include/__bit_reference:15:
In file included from external/libcxx/include/algorithm:626:
external/libcxx/include/cstring:67:1: error: expected ';' after top level declarator
external/libcxx/include/__config:386:51: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
                                                  ^
In file included from device/asus/grouper/dumpstate/dumpstate.c:17:
In file included from frameworks/native/cmds/dumpstate/dumpstate.h:48:
In file included from external/libcxx/include/vector:265:
In file included from external/libcxx/include/__bit_reference:15:
In file included from external/libcxx/include/algorithm:628:
In file included from external/libcxx/include/memory:603:
external/libcxx/include/new:136:38: error: expected ';' after top level declarator
_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
                                     ^
external/libcxx/include/new:137:30: error: variable has incomplete type 'void'
_LIBCPP_NEW_DELETE_VIS void  operator delete(void* __p) _NOEXCEPT;
                             ^
external/libcxx/include/new:137:38: error: expected ';' after top level declarator
_LIBCPP_NEW_DELETE_VIS void  operator delete(void* __p) _NOEXCEPT;
                                     ^
external/libcxx/include/new:138:30: error: variable has incomplete type 'void'
_LIBCPP_NEW_DELETE_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
                             ^
external/libcxx/include/new:138:38: error: expected ';' after top level declarator
_LIBCPP_NEW_DELETE_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
                                     ^
external/libcxx/include/new:144:38: error: expected ';' after top level declarator
_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz)
                                     ^
external/libcxx/include/new:149:38: error: expected ';' after top level declarator
_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
                                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[  0% 7/15320] Ensure Jack server is installed and started
Jack server already installed in "/home/daniel/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/daniel/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
ninja: build stopped: subcommand failed.
make: *** [build/core/ninja.mk:149: ninja_wrapper] Error 1

#### make failed to build some targets (01:50 (mm:ss)) ###


Thank you very much for your help.

Regards,
DD

Colin Cross

unread,
Sep 6, 2016, 12:21:54 PM9/6/16
to android-...@googlegroups.com
You left out the line that starts with FAILED:, which lists the exact
command that failed.

It appears you are trying to compile with device/asus/grouper, which
has been removed from the tree and is no longer supported. Did you
manually add that back to your source tree?

Daniel Dawson

unread,
Sep 6, 2016, 7:06:22 PM9/6/16
to Android Building
Hello again,

My appoligies for leaving out the FAILED block:


FAILED: /bin/bash -c "(PWD=/proc/self/cwd prebuilts/misc/linux-x86/ccache/ccache prebuilts/clang/host/linux-x86/clang-2690385/bin/clang -I frameworks/native/cmds/dumpstate -I device/asus/grouper/dumpstate -I out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates -I out/target/product/grouper/gen/STATIC_LIBRARIES/libdumpstate.grouper_intermediates -I libnativehelper/include/nativehelper \$(cat out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/import_includes) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem hardware/ril/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem out/target/product/grouper/obj/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/common -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libm/include -isystem bionic/libm/include/arm -c    -fno-exceptions -Wno-multichar -msoft-float -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -DNDEBUG -g -Wstrict-aliasing=2 -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -nostdlibinc  -target arm-linux-androideabi    -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin    -std=gnu99     -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing   -fPIC -D_USING_LIBCXX   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast  -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type  -MD -MF out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.d -o out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.o device/asus/grouper/dumpstate/dumpstate.c ) && (cp out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.d out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\\$//' -e '/^\$/ d' -e 's/\$/ :/' < out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.d >> out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.P; rm -f out/target/product/grouper/obj/STATIC_LIBRARIES/libdumpstate.grouper_intermediates/dumpstate.d )"
 
As for building for Grouper, it does come from Android 5.1; although I have made some minor modifications to allow it to run later versions of Android. I was able to build and run Android 6 successfully. I think that it is a library issue, though I could be wrong.

Many Thanks,
DD

Colin Cross

unread,
Sep 6, 2016, 8:23:41 PM9/6/16
to android-...@googlegroups.com
The framework dumpstate was converted to c++, grouper's libdumpstate
needs to be converted to match. See
https://android.googlesource.com/device/htc/flounder/+/1ef2d9feeaf70605c04884f61205bd2ac8815574
for an example of the same change made for flounder.

Daniel Dawson

unread,
Sep 7, 2016, 2:57:46 PM9/7/16
to Android Building
Thanks very much for your help!

Regards,
DD
Reply all
Reply to author
Forward
0 new messages