servo / rust-mozjs

DEPRECATED - moved to servo/mozjs instead.
Mozilla Public License 2.0
293 stars 122 forks source link

Linker fails when compiling tests for Android #346

Closed vmx closed 6 years ago

vmx commented 7 years ago

The linker fails when running the tests via cargo test --target=arm-linux-androideabi. See the error and full command line below:

PATH=$PATH:/home/vmx/src/rust/android/android-24-toolchain/bin ANDROID_NDK=/home/vmx/src/rust/android/android-ndk-r12b ANDROID_SDK=/home/vmx/src/rust/android/android-sdk-linux cargo test --target=arm-linux-androideabi 
   Compiling js v0.1.4 (file:///tmp/rust-mozjs)
warning: constant item is never used: `ChunkLocationOffset`
   --> src/rust.rs:581:1
    |
581 | const ChunkLocationOffset: usize = ChunkSize - 2 * 4 - 8;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(dead_code)] on by default

error: linking with `/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc` failed: exit code: 1
  |
  = note: "/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/vec_conversion-7ffa01786b043d06.0.o" "-o" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/vec_conversion-7ffa01786b043d06" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps" "-L" "/tmp/rust-mozjs/target/debug/deps" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/js-62abd7c6dbea0549/out/lib" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/mozjs_sys-2cecbe7697181d13/out/js/src" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libjs-bf95172d2256808a.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libheapsize-a0ca106bb4f4bbb6.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblog-d4c0e5c2504fbbea.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libnum_traits-69f4129d46397118.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblazy_static-6512ce482ce46607.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libmozjs_sys-97826a5d9cd703db.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibz_sys-b34e05ee2e9e1468.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibc-5dc7b85e748840b4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libtest-6c35a477e7bec8d3.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libterm-fa872424129019f5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libgetopts-a80f7c589731de53.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd-f4594d3e53dcb114.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libunwind-488b4ab4bd53a138.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/librand-1efbcfd8938372b6.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcollections-532a3dbf317eff86.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc-ca07b617414dd0fa.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liblibc-88c194c15fdb6521.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcore-687e6a964d22cbb4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "stdc++" "-l" "z" "-l" "dl" "-l" "log" "-l" "gcc" "-l" "gcc" "-l" "c" "-l" "m"
  = note: /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ctype<char>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:947: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__ndk1::locale::locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:166: error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:272: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/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

error: aborting due to previous error

error: Could not compile `js`.
Build failed, waiting for other jobs to finish...
error: linking with `/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc` failed: exit code: 1
  |
  = note: "/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/evaluate-d34b8b3272ee9ae7.0.o" "-o" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/evaluate-d34b8b3272ee9ae7" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps" "-L" "/tmp/rust-mozjs/target/debug/deps" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/js-62abd7c6dbea0549/out/lib" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/mozjs_sys-2cecbe7697181d13/out/js/src" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libjs-bf95172d2256808a.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libheapsize-a0ca106bb4f4bbb6.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblog-d4c0e5c2504fbbea.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libnum_traits-69f4129d46397118.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblazy_static-6512ce482ce46607.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libmozjs_sys-97826a5d9cd703db.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibz_sys-b34e05ee2e9e1468.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibc-5dc7b85e748840b4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libtest-6c35a477e7bec8d3.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libterm-fa872424129019f5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libgetopts-a80f7c589731de53.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd-f4594d3e53dcb114.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libunwind-488b4ab4bd53a138.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/librand-1efbcfd8938372b6.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcollections-532a3dbf317eff86.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc-ca07b617414dd0fa.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liblibc-88c194c15fdb6521.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcore-687e6a964d22cbb4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "stdc++" "-l" "z" "-l" "dl" "-l" "log" "-l" "gcc" "-l" "gcc" "-l" "c" "-l" "m"
  = note: /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ctype<char>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:947: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__ndk1::locale::locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:166: error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:272: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/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

error: aborting due to previous error

error: Could not compile `js`.
Build failed, waiting for other jobs to finish...
error: linking with `/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc` failed: exit code: 1
  |
  = note: "/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/typedarray-40fe3cba16701bae.0.o" "-o" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/typedarray-40fe3cba16701bae" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps" "-L" "/tmp/rust-mozjs/target/debug/deps" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/js-62abd7c6dbea0549/out/lib" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/mozjs_sys-2cecbe7697181d13/out/js/src" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libjs-bf95172d2256808a.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libheapsize-a0ca106bb4f4bbb6.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblog-d4c0e5c2504fbbea.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libnum_traits-69f4129d46397118.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblazy_static-6512ce482ce46607.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libmozjs_sys-97826a5d9cd703db.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibz_sys-b34e05ee2e9e1468.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibc-5dc7b85e748840b4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libtest-6c35a477e7bec8d3.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libterm-fa872424129019f5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libgetopts-a80f7c589731de53.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd-f4594d3e53dcb114.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libunwind-488b4ab4bd53a138.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/librand-1efbcfd8938372b6.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcollections-532a3dbf317eff86.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc-ca07b617414dd0fa.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liblibc-88c194c15fdb6521.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcore-687e6a964d22cbb4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "stdc++" "-l" "z" "-l" "dl" "-l" "log" "-l" "gcc" "-l" "gcc" "-l" "c" "-l" "m"
  = note: /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ctype<char>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:947: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__ndk1::locale::locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:166: error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:272: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/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

error: aborting due to previous error

error: Could not compile `js`.
Build failed, waiting for other jobs to finish...
error: linking with `/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc` failed: exit code: 1
  |
  = note: "/home/vmx/src/rust/android/android-24-toolchain/bin/arm-linux-androideabi-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/js-5fbcd13e1993ffc3.0.o" "-o" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/js-5fbcd13e1993ffc3" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps" "-L" "/tmp/rust-mozjs/target/debug/deps" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/js-62abd7c6dbea0549/out/lib" "-L" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/build/mozjs_sys-2cecbe7697181d13/out/js/src" "-L" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l" "jsglue" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libheapsize-a0ca106bb4f4bbb6.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblog-d4c0e5c2504fbbea.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libnum_traits-69f4129d46397118.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblazy_static-6512ce482ce46607.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/libmozjs_sys-97826a5d9cd703db.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libtest-6c35a477e7bec8d3.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libterm-fa872424129019f5.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibz_sys-b34e05ee2e9e1468.rlib" "/tmp/rust-mozjs/target/arm-linux-androideabi/debug/deps/liblibc-5dc7b85e748840b4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libgetopts-a80f7c589731de53.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd-f4594d3e53dcb114.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libunwind-488b4ab4bd53a138.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/librand-1efbcfd8938372b6.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcollections-532a3dbf317eff86.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc-ca07b617414dd0fa.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/liblibc-88c194c15fdb6521.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcore-687e6a964d22cbb4.rlib" "/home/vmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/arm-linux-androideabi/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "stdc++" "-l" "z" "-l" "dl" "-l" "log" "-l" "gcc" "-l" "gcc" "-l" "c" "-l" "m"
  = note: /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ctype<char>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:661: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::locale::~locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:947: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:370: error: undefined reference to 'std::__ndk1::locale::locale()'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:166: error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:272: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
          /home/vmx/src/rust/android/android-ndk-r12b/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
          /home/vmx/src/rust/android/android-ndk-r12b/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

error: aborting due to previous error

error: build failed

In case you want to have a simple file to compile, an almost minimal example that shows the same issue is:

#[macro_use]
extern crate js;

use js::jsapi::CallArgs;

fn send(args: &CallArgs) {
    args.get(1);
}

fn main() {
    println!("Without `args.get(1)` the compilation wouldn't fail");
}
emilio commented 7 years ago

Seems that we're not linking the ndk on android. I'm not sure whether that should be done on this crate or on the executable. Perhaps explicitly linking it fixes the problem for you?

vmx commented 7 years ago

Explicit linking on the executable sounds good to me. Do you have any pointers on how to do that?

jdm commented 7 years ago

https://github.com/servo/servo/blob/master/ports/servo/build.rs looks like it might be relevant to that.

vmx commented 7 years ago

I played around with @tomaka's android-rs-glue and tried to understand what it does differently (it use its own linker script). Sadly (after a few hours) I sadly still can't build my code for Android. Further help is appreciated (else I'll keep digging some other time).

vmx commented 7 years ago

The linking is successful when I add --sysroot /home/vmx/src/rust/android/android-ndk-r12b/platforms/android-18/arch-arm -shared at the end of the linker command. Though that means that a shared library is created, which isn't really what I want, is it?

vmx commented 7 years ago

If someone wants to try it on a stand-alone minimal example repository, I've created one: https://github.com/vmx/rust-mozjs-issue-346

vmx commented 6 years ago

Seems to be fixed. I haven't tried if it actually runs on Android, but at least I don't get an error message when I compile it. Thanks a lot for fixing it.