Skip to content

Android build fails #13154

@dati91

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.

Metadata

Metadata

Assignees

Labels

A-buildRelated to or part of the build processP-androidAndroid devices

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions