Skip to content

Android build fails #13154

Closed
Closed

Description

@dati91

The current android build is failing with the following issues:

  • libfontconfig error
  • android_start! macro
  • backtrace
  • linker error 1
  • linker error 2

The libfontconfig error

--- stderr
configure: WARNING: using cross tools not prefixed with host triplet
configure: error: 
*** expat is required. or try to use --enable-libxml2
make: *** [servo/target/arm-linux-androideabi/debug/build/servo-fontconfig-sys-0c6dc76cced7fb8b/out/Makefile] Error 1
thread 'main' panicked at 'assertion failed: Command::new("make").args(&["-R", "-f",
                            "makefile.cargo"]).status().unwrap().success()', servo/.cargo/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-4.0.1/build.rs:17

This will be solved with servo-fontconfig-sys-4.0.2. Fixed with this.

The android_start! macro

error: macro undefined: 'android_start!'
   --> main.rs:265:1
    |
265 | android_start!(main);
    | ^^^^^^^^^^^^^

This is related to the android-rs-glue update (0.1.3 -> 0.2.0). Which was introduced in this pr.

If we comment out the macro, we can move to our next error.

Backtrace in unguarded code

error[E0432]: unresolved import `backtrace::Backtrace`
  --> main.rs:37:5
   |
37 | use backtrace::Backtrace;
   |     ^^^^^^^^^^^^^^^^^^^^ Maybe a missing `extern crate backtrace`?

This was introduced with this pr.
If we revert this, we will get to the linking phase.

Linker Error 1

arm-linux-androideabi-gcc: error: : No such file or directory

This is caused by this line, the "${LDFLAGS-}" is empty.
If we get rid of that, we will arrive to our last obstacle.

Linker Error 2

servo/.cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.0/src/lib.rs:111: error: undefined reference to 'cargo_apk_injected_glue_write_log'
servo/.cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.0/src/lib.rs:103: error: undefined reference to 'cargo_apk_injected_glue_get_native_window'
servo/.cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.0/src/lib.rs:75: error: undefined reference to 'cargo_apk_injected_glue_add_sender'
servo/.cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.0/src/lib.rs:82: error: undefined reference to 'cargo_apk_injected_glue_set_multitouch'
servo/.cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.0/src/lib.rs:103: error: undefined reference to 'cargo_apk_injected_glue_get_native_window'
servo/target/arm-linux-androideabi/debug/deps/libservo.rlib(android_native_app_glue.o):android_native_app_glue.c:function android_app_entry: error: undefined reference to 'android_main'
servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:193: error: undefined reference to 'unshare'
servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:249: error: undefined reference to 'unshare'
servo/.cargo/git/checkouts/rust-mozjs-8611526964119dd6/master/src/jsglue.cpp:724: error: undefined reference to 'malloc_usable_size'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ctype<char>::id'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:947: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__ndk1::locale::locale()'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:166: error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:272: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/iterator:846: error: undefined reference to 'std::__ndk1::ctype<char>::id'
collect2: error: ld returned 1 exit status

Which is related to the android_glue update mentioned above.

Activity

  1. aneeshusa commented on Sep 2, 2016

    @aneeshusa
    Contributor

    Thanks for the detective work! I think we can get rid of $LDFLAGS entirely but I'm not sure, see #12562.

  2. added
    P-android
    A-build
    on Sep 4, 2016
  3. self-assigned this
    on Sep 8, 2016
  4. larsbergstrom commented on Sep 8, 2016

    @larsbergstrom
    Contributor

    I am working on this.

  5. larsbergstrom commented on Sep 30, 2016

    @larsbergstrom
    Contributor
  6. vmx commented on Oct 4, 2016

    @vmx

    A new failure got introduced. You'll hit it as first one, before the "libfontconfig error" one.

    error[E0432]: unresolved import `libc::AF_NETLINK`
      --> /home/vmx/src/rust/servo/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/seccomp.rs:24:46
       |
    24 | use libc::{self, AF_INET, AF_INET6, AF_UNIX, AF_NETLINK};
       |                                              ^^^^^^^^^^ no `AF_NETLINK` in `libc`
    

    It got introduced by commit servo/gaol@039661b.

    Going back to commit servo/gaol@8c78910 works and the build advances to the libconfig error.

  7. added a commit that references this issue on Oct 10, 2016
  8. added 2 commits that reference this issue on Oct 11, 2016
  9. mmatyas commented on Oct 13, 2016

    @mmatyas
    Contributor

    After some hacks, I've managed to build it; I'll clean my patches up a bit and post additional PRs soon. I have some problems with creating the APK currently, but I'll test it on a device as soon as I can.

  10. mmatyas commented on Oct 17, 2016

    @mmatyas
    Contributor

    Here are the remaining patches -- I didn't send PRs for them because ~~~some of them are hacks (fontsan, libfontconfig),~~~ some may be Servo-specific (libheartbeats), and the backtrace build fix may not work on real device. These patches work with @larsbergstrom's patch, using NDK v12 (because v13 doesn't build at all, probably due to GCC/Clang changes).

    https://gist.github.com/mmatyas/cb9eac611b6ce350158e4421651bf4dd

    UPDATE: I've removed the patches for which there are PRs.

  11. mmatyas commented on Oct 17, 2016

    @mmatyas
    Contributor
  12. mmatyas commented on Oct 18, 2016

    @mmatyas
    Contributor

    I've found the bug in fontsan and libfontconfig, the C/CXX flags were not captured properly.

  13. added a commit that references this issue on Oct 18, 2016
  14. 64 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-buildP-android

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions