Closed Bug 1485833 Opened Last year Closed Last year

Back out Bug 1484823 so NDK 15c can still be used for local builds.

Categories

(Firefox Build System :: Android Studio and Gradle Integration, enhancement)

63 Branch
All
Android
enhancement
Not set

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: rbarker, Assigned: JanH)

References

Details

Attachments

(1 file)

Bug 1484823 prevents using NDK 15c to build for Android. Unfortunately the newer NDKs seem to have issues when doing local builds. Bug 1484823 should be backed out until solutions for the new NDKs can be found.
Wouldn't it be possible to make my change backwards-compatible using __has_include?
Maybe? Feel free to file a follow up. I can't test it since I am unable build with ndk 17b or ndk 18 beta.
I think the best way is to detect the actual type that the JNI function uses, e.g.,

> class CallArgs {
>     static const jvalue* test(void (JNIEnv::*)(jobject, jmethodID, const jvalue*));
>     static jvalue* test(void (JNIEnv::*)(jobject, jmethodID, jvalue*));
> public:
>     using Type = decltype(test(&JNIEnv::CallVoidMethodA));
> };

Then use `CallArgs::Type` as the pointer type.
@Randall: Also which configuration (NDK version [1], target architecture, host system) and what problem exactly? I appreciate that the short-term concern is having a working local build, but either it's something we should fix on our side, or else report to Google if it's an NDK bug.

[1] I see that Beta 2 has just been released, so did try Beta 1 or 2?
Flags: needinfo?(rbarker)
I'm building for arm7. I tried with NDK 17b but get the segfault. I tried with NDK 18 beta 2 and get compiler errors in rust code picking up the wrong system headers. I think until a released NDK can be used with out jumping through hoops, we should not be forcing people to upgrade. I wasted half a day trying to unbreak my build. I eventually just reverted Bug 1484823 locally, switched back to NDK 15c and got back to work.
Flags: needinfo?(rbarker)
It also broke my build, this is the stacktrace

>110 actionable tasks: 5 executed, 105 up-to-date
> 0:22.62 force-cargo-library-build
> 0:22.63 js/src
> 0:22.68 security/certverifier/tests/gtest
> 0:22.70 security/apps
> 0:22.91 xpcom/string
> 0:22.91 xpcom/glue/standalone
> 0:25.51 libxpcomglue.a
> 0:25.51 xpcom/base
> 0:26.70     Finished release [optimized] target(s) in 3.95s
> 0:27.22 xpcom/ds
> 0:39.42 xpcom/io
> 0:40.65 xpcom/components
> 0:43.37 xpcom/threads
> 0:43.90 xpcom/reflect/xptinfo
> 0:57.68 xpcom/reflect/xptcall
> 0:57.84 0  clang++                  0x00000001087cf9c8 llvm::SmallVectorImpl<char>::swap(llvm::SmallVectorImpl<char>&) + 46568
> 0:57.84 1  clang++                  0x00000001087cffd6 llvm::SmallVectorImpl<char>::swap(llvm::SmallVectorImpl<char>&) + 48118
> 0:57.84 2  libsystem_platform.dylib 0x00007fff684b7f5a _sigtramp + 26
> 0:57.85 3  libsystem_platform.dylib 0x0000000000000034 _sigtramp + 2545189108
> 0:57.85 4  clang++                  0x0000000108f67436 llvm::SmallVectorTemplateBase<std::__1::pair<llvm::SDValue, llvm::SmallVector<int, 16u> >, false>::grow(unsigned long) + 106822
> 0:57.85 5  clang++                  0x0000000108f65c47 llvm::SmallVectorTemplateBase<std::__1::pair<llvm::SDValue, llvm::SmallVector<int, 16u> >, false>::grow(unsigned long) + 100695
> 0:57.85 6  clang++                  0x0000000108f7c1d0 llvm::SmallVectorTemplateBase<std::__1::pair<llvm::SDValue, llvm::SmallVector<int, 16u> >, false>::grow(unsigned long) + 192224
> 0:57.85 7  clang++                  0x0000000108f81bd9 std::__1::enable_if<(__is_forward_iterator<llvm::SDUse*>::value) && (is_constructible<llvm::SDValue, std::__1::iterator_traits<llvm::SDUse*>::reference>::value), std::__1::__wrap_iter<llvm::SDValue*> >::type std::__1::vector<llvm::SDValue, std::__1::allocator<llvm::SDValue> >::insert<llvm::SDUse*>(std::__1::__wrap_iter<llvm::SDValue const*>, llvm::SDUse*, llvm::SDUse*) + 16825
> 0:57.85 8  clang++                  0x0000000109055877 std::__1::__tree<llvm::EVT, llvm::EVT::compareRawBits, std::__1::allocator<llvm::EVT> >::destroy(std::__1::__tree_node<llvm::EVT, void*>*) + 48087
> 0:57.85 9  clang++                  0x0000000109054a19 std::__1::__tree<llvm::EVT, llvm::EVT::compareRawBits, std::__1::allocator<llvm::EVT> >::destroy(std::__1::__tree_node<llvm::EVT, void*>*) + 44409
> 0:57.85 10 clang++                  0x000000010905189d std::__1::__tree<llvm::EVT, llvm::EVT::compareRawBits, std::__1::allocator<llvm::EVT> >::destroy(std::__1::__tree_node<llvm::EVT, void*>*) + 31741
> 0:57.85 11 clang++                  0x00000001079f1a94 std::__1::function<void (llvm::MachineInstrBuilder&)>::swap(std::__1::function<void (llvm::MachineInstrBuilder&)>&) + 1364
> 0:57.85 12 clang++                  0x00000001080aab9a void std::__1::vector<llvm::MachineConstantPoolEntry, std::__1::allocator<llvm::MachineConstantPoolEntry> >::__push_back_slow_path<llvm::MachineConstantPoolEntry>(llvm::MachineConstantPoolEntry&&) + 858
> 0:57.85 13 clang++                  0x000000010831344e std::__1::enable_if<is_hashable_data<llvm::Metadata* const>::value, llvm::hash_code>::type llvm::hashing::detail::hash_combine_range_impl<llvm::Metadata* const>(llvm::Metadata* const*, llvm::Metadata* const*) + 30462
> 0:57.86 14 clang++                  0x00000001083136d3 std::__1::enable_if<is_hashable_data<llvm::Metadata* const>::value, llvm::hash_code>::type llvm::hashing::detail::hash_combine_range_impl<llvm::Metadata* const>(llvm::Metadata* const*, llvm::Metadata* const*) + 31107
> 0:57.86 15 clang++                  0x0000000108313b8a std::__1::enable_if<is_hashable_data<llvm::Metadata* const>::value, llvm::hash_code>::type llvm::hashing::detail::hash_combine_range_impl<llvm::Metadata* const>(llvm::Metadata* const*, llvm::Metadata* const*) + 32314
> 0:57.86 16 clang++                  0x000000010898038b void std::__1::vector<clang::vfs::directory_iterator, std::__1::allocator<clang::vfs::directory_iterator> >::__push_back_slow_path<clang::vfs::directory_iterator const&>(clang::vfs::directory_iterator const&&&) + 22043
> 0:57.86 17 clang++                  0x0000000108b3c5d1 void std::__1::vector<std::__1::pair<clang::CXXRecordDecl const*, unsigned int>, std::__1::allocator<std::__1::pair<clang::CXXRecordDecl const*, unsigned int> > >::__push_back_slow_path<std::__1::pair<clang::CXXRecordDecl const*, unsigned int> >(std::__1::pair<clang::CXXRecordDecl const*, unsigned int>&&) + 25057
> 0:57.86 18 clang++                  0x000000010943f102 llvm::ErrorOr<unsigned long long> llvm::sampleprof::SampleProfileReaderBinary::readNumber<unsigned long long>() + 14834
> 0:57.86 19 clang++                  0x0000000108daf330 llvm::Registry<clang::PluginASTAction>::begin() + 17856
> 0:57.86 20 clang++                  0x0000000108d4ee78 void std::__1::vector<std::__1::unique_ptr<clang::CompilerInstance, std::__1::default_delete<clang::CompilerInstance> >, std::__1::allocator<std::__1::unique_ptr<clang::CompilerInstance, std::__1::default_delete<clang::CompilerInstance> > > >::__push_back_slow_path<std::__1::unique_ptr<clang::CompilerInstance, std::__1::default_delete<clang::CompilerInstance> > >(std::__1::unique_ptr<clang::CompilerInstance, std::__1::default_delete<clang::CompilerInstance> >&&) + 29720
> 0:57.86 21 clang++                  0x0000000108df8510 void std::__1::vector<std::__1::unique_ptr<clang::VerifyDiagnosticConsumer::Directive, std::__1::default_delete<clang::VerifyDiagnosticConsumer::Directive> >, std::__1::allocator<std::__1::unique_ptr<clang::VerifyDiagnosticConsumer::Directive, std::__1::default_delete<clang::VerifyDiagnosticConsumer::Directive> > > >::__push_back_slow_path<std::__1::unique_ptr<clang::VerifyDiagnosticConsumer::Directive, std::__1::default_delete<clang::VerifyDiagnosticConsumer::Directive> > >(std::__1::unique_ptr<clang::VerifyDiagnosticConsumer::Directive, std::__1::default_delete<clang::VerifyDiagnosticConsumer::Directive> >&&) + 9376
> 0:57.86 22 clang++                  0x0000000107849eff std::__1::__tree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::destroy(std::__1::__tree_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>*) + 1759
> 0:57.86 23 clang++                  0x0000000107847f8e
> 0:57.86 24 libdyld.dylib            0x00007fff681a9015 start + 1
> 0:57.86 Stack dump:
> 0:57.87 0.	Program arguments: /Users/mortimer/.mozbuild/android-ndk-r17b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -cc1 -triple thumbv7--linux-android -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name Unified_cpp_js_src17.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu generic -target-feature +soft-float-abi -target-feature -fp-only-sp -target-feature -d16 -target-feature +vfp3 -target-feature -fp16 -target-feature -vfp4 -target-feature -fp-armv8 -target-feature +neon -target-feature -crypto -target-feature +strict-align -target-abi aapcs-linux -mfloat-abi soft -fallow-half-arguments-and-returns -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -target-linker-version 241.9 -coverage-notes-file /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src/Unified_cpp_js_src17.gcno -resource-dir /Users/mortimer/.mozbuild/android-ndk-r17b/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/6.0.2 -dependency-file .deps/Unified_cpp_js_src17.o.pp -MT Unified_cpp_js_src17.o -sys-header-deps -MP -include /Users/mortimer/Projects/gecko/config/gcc_hidden.h -include /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src/js-confdefs.h -isystem /Users/mortimer/.mozbuild/android-ndk-r17b/sysroot/usr/include/arm-linux-androideabi -isystem /Users/mortimer/.mozbuild/android-ndk-r17b/sysroot/usr/include -I /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/dist/system_wrappers -D NDEBUG=1 -D TRIMMED=1 -D ENABLE_BINARYDATA -D ENABLE_WASM_BULKMEM_OPS -D ENABLE_WASM_SATURATING_TRUNC_OPS -D ENABLE_WASM_THREAD_OPS -D ENABLE_WASM_GC -D JS_CACHEIR_SPEW -D ENABLE_SHARED_ARRAY_BUFFER -D EXPORT_JS_API -D JS_HAS_CTYPES -D DLL_PREFIX="lib" -D DLL_SUFFIX=".so" -D MOZ_LINKER -D FFI_BUILDING -D MOZ_HAS_MOZGLUE -I /Users/mortimer/Projects/gecko/js/src -I /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src -I /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src/ctypes/libffi/include -I /Users/mortimer/Projects/gecko/js/src/ctypes/libffi/src/arm -I /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/dist/include -I /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/dist/include/nspr -D MOZILLA_CLIENT -D __ANDROID_API__=16 -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -I /Users/mortimer/.mozbuild/android-ndk-r17b/sources/cxx-stl/llvm-libc++/include -I /Users/mortimer/.mozbuild/android-ndk-r17b/sources/android/support/include -I /Users/mortimer/.mozbuild/android-ndk-r17b/sources/cxx-stl/llvm-libc++abi/include -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -internal-isystem /usr/local/include -internal-isystem /Users/mortimer/.mozbuild/android-ndk-r17b/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/6.0.2/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++1z-compat -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wtautological-overlap-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-noexcept-type -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-shadow -Werror=format -std=gnu++14 -fdeprecated-macro -fdebug-compilation-dir /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src -ferror-limit 19 -fmessage-length 0 -femulated-tls -fno-rtti -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o Unified_cpp_js_src17.o -x c++ /Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src/Unified_cpp_js_src17.cpp
> 0:57.87 1.	<eof> parser at end of file
> 0:57.87 2.	Code generation
> 0:57.87 3.	Running pass 'Function Pass Manager' on module '/Users/mortimer/Projects/gecko/obj-arm-linux-androideabi/js/src/Unified_cpp_js_src17.cpp'.
> 0:57.87 4.	Running pass 'ARM Instruction Selection' on function '@_ZN2js3jit22CacheRegisterAllocator20saveIonLiveRegistersERNS0_14MacroAssemblerENS0_7LiveSetINS0_11RegisterSetEEENS0_8RegisterEPNS0_9IonScriptE'
> 0:57.87 clang++: error: unable to execute command: Segmentation fault: 11
> 0:57.88 clang++: error: clang frontend command failed due to signal (use -v to see invocation)
> 0:57.88 Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)
> 0:57.88 Target: arm--linux-android
> 0:57.88 Thread model: posix
> 0:57.88 InstalledDir: /Users/mortimer/.mozbuild/android-ndk-r17b/toolchains/llvm/prebuilt/darwin-x86_64/bin
> 0:57.88 clang++: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
> 0:58.25 clang++: note: diagnostic msg:
> 0:58.25 ********************
> 0:58.25 PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> 0:58.25 Preprocessed source(s) and associated run script(s) are located at:
> 0:58.25 clang++: note: diagnostic msg: /var/folders/2y/vt0hx41524b8kkg1sr61krh00000gn/T/Unified_cpp_js_src17-328dca.cpp
> 0:58.25 clang++: note: diagnostic msg: /var/folders/2y/vt0hx41524b8kkg1sr61krh00000gn/T/Unified_cpp_js_src17-328dca.sh
> 0:58.25 clang++: note: diagnostic msg: Crash backtrace is located in
> 0:58.25 clang++: note: diagnostic msg: /Users/mortimer/Library/Logs/DiagnosticReports/clang++_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
> 0:58.25 clang++: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
> 0:58.25 clang++: note: diagnostic msg:
> 0:58.25 ********************
Blocks: 1484823
@Imanol: The clang in r17b is known to be buggy when building for ARM.
Your choices are:
- Try the r18 Beta NDK.
- If you've got a new enough clang installed locally, try building with that (Add CC=clang and CCX=clang to your mozconfig, although further config options might be required to get this working).
- Back out bug 1484823 locally and build with r15c again.
- Take the patch from this bug which I'm going to post soon (or wait for it to land in central) and build with r15c.
Assignee: nobody → jh+bugzilla
OS: Unspecified → Android
Hardware: Unspecified → All
Version: Trunk → Firefox 63
When building with the NDK clang, which is the easiest way of building locally,
NDK r17 doesn't work for ARM builds because of a broken clang, and while the
NDK r18-beta fixes that problem, for some people it causes a different set of
issues.
Since NDK r15c doesn't have the ndk-version.h headers, switch to a different
way of bridging the differences that allows people to continue building with
r15c locally.
Comment on attachment 9004653 [details]
Bug 1485833 - Use a backwards compatible way of handling NDK changes in jni.h. r?jchen

Jim Chen [:jchen] [:darchons] has approved the revision.
Attachment #9004653 - Flags: review+
Pushed by mozilla@buttercookie.de:
https://hg.mozilla.org/integration/autoland/rev/db8f2c713e4c
Use a backwards compatible way of handling NDK changes in jni.h. r=jchen
https://hg.mozilla.org/mozilla-central/rev/db8f2c713e4c
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 63 → mozilla63
Version: Firefox 63 → 63 Branch
You need to log in before you can comment on or make changes to this bug.