Closed Bug 1482330 Opened 2 years ago Closed 2 years ago

Upgrade to Android NDK r17b and api level 16 (JB)

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → mh+mozilla
We're currently using NDK r15c, which is rather old, and happens to come
with a buggy gold linker. Let's use a more recent NDK, with a fixed
linker.

Unfortunately, we're currently at NDK API level 9, which the newer NDK
doesn't provide for x86 anymore. But that corresponds to Gingerbread
(2.3), which we've long stopped supporting. On the SDK side, we already
dropped support of versions before Jelly Bean, so we can do the same on
the NDK side. That corresponds to API level 16. So let's just use that
as a baseline.

Another change in the newer NDK is that the target-name changed from
i386-linux-android to i686-linux-android, so adjust for that in the
android x86 mozconfigs.
Attachment #8999079 - Flags: review?(snorp)
Comment on attachment 8999079 [details] [diff] [review]
Upgrade to Android NDK r17b and API level 16 (JB)

Review of attachment 8999079 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine as long as it builds. I found in bug 1465468 that you need to add -Wno-error=tautological-constant-compare, and the ARM builds crash.
Attachment #8999079 - Flags: review?(snorp) → review+
We're not using the compiler from the NDK anymore, so it's actually not a problem for us. We use the NDK for the libs and headers, as well as binutils.
(In reply to Mike Hommey [:glandium] from comment #3)
> We're not using the compiler from the NDK anymore, so it's actually not a
> problem for us. We use the NDK for the libs and headers, as well as binutils.

Oh, how do I do that for local builds?
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/003838e8d110
Upgrade to Android NDK r17b and API level 16 (JB). r=snorp
ac_add_options CC=clang
Flags: needinfo?(mh+mozilla)
Backed out changeset 003838e8d110 (Bug 1482330) for Adnroid build bustages on mozalloc_abort.cpp  

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=003838e8d1104f2f2728a3713ba4d54a6de96af5

Backout link: https://hg.mozilla.org/integration/mozilla-inbound/rev/7ed5ed3d48146ef939a6ca4cba221430128ba5f5

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=193374680&repo=mozilla-inbound&lineNumber=4353

[task 2018-08-10T22:49:29.232Z] 22:49:29     INFO -  make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/build/unix/stdc++compat'
[task 2018-08-10T22:49:29.233Z] 22:49:29     INFO -  make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/config/external/nspr/libc'
[task 2018-08-10T22:49:29.233Z] 22:49:29     INFO -  make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/config/external/nspr/libc'
[task 2018-08-10T22:49:29.354Z] 22:49:29     INFO -  make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/memory/mozalloc'
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/sccache2/sccache /builds/worker/workspace/build/src/clang/bin/clang++ --target=aarch64-linux-android -o mozalloc_abort.o -c -DNDEBUG=1 -DTRIMMED=1 -D_GNU_SOURCE -DIMPL_MFBT -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/memory/mozalloc -I/builds/worker/workspace/build/src/obj-firefox/memory/mozalloc -I/builds/worker/workspace/build/src/obj-firefox/xpcom -I/builds/worker/workspace/build/src/memory/build -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include/aarch64-linux-android -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include -gcc-toolchain /builds/worker/workspace/build/src/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -D__ANDROID_API__=21 -Qunused-arguments -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wloop-analysis -Wc++1z-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-sized-deallocation -fno-short-enums -fno-exceptions -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++/include -I/builds/worker/workspace/build/src/android-ndk/sources/android/support/include -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++abi/include -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -g -Oz -fno-omit-frame-pointer -funwind-tables -Werror  -MD -MP -MF .deps/mozalloc_abort.o.pp   /builds/worker/workspace/build/src/memory/mozalloc/mozalloc_abort.cpp
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/memory/mozalloc/mozalloc_abort.cpp:49:37: error: use of undeclared identifier 'strrchr'
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -      const char* const base_module = strrchr(module, '/');
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -                                      ^
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/memory/mozalloc/mozalloc_abort.cpp:49:23: error: default initialization of an object of const type 'const char *const'
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -      const char* const base_module = strrchr(module, '/');
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -                        ^
[task 2018-08-10T22:49:29.360Z] 22:49:29     INFO -                                    = nullptr
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/memory/mozalloc/mozalloc_abort.cpp:76:5: note: in instantiation of function template specialization 'fillAbortMessage<64>' requested here
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -      fillAbortMessage(msg, uintptr_t(__builtin_return_address(0)));
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -      ^
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  2 errors generated.
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/config/rules.mk:1088: recipe for target 'mozalloc_abort.o' failed
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  make[4]: *** [mozalloc_abort.o] Error 1
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/memory/mozalloc'
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/modules/zlib/src'
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/sccache2/sccache /builds/worker/workspace/build/src/clang/bin/clang -std=gnu99 --target=aarch64-linux-android -o adler32.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DIMPL_MFBT -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/modules/zlib/src -I/builds/worker/workspace/build/src/obj-firefox/modules/zlib/src -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include/aarch64-linux-android -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include -gcc-toolchain /builds/worker/workspace/build/src/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -D__ANDROID_API__=21 -Qunused-arguments -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wclass-varargs -Wloop-analysis -Werror=non-literal-null-conversion -Wstring-conversion -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -fno-short-enums -fno-exceptions -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pipe -g -Oz -fno-omit-frame-pointer -funwind-tables -Werror  -MD -MP -MF .deps/adler32.o.pp   /builds/worker/workspace/build/src/modules/zlib/src/adler32.c
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/modules/zlib/src'
[task 2018-08-10T22:49:29.363Z] 22:49:29     INFO -  make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/modules/fdlibm/src'
[task 2018-08-10T22:49:29.365Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/sccache2/sccache /builds/worker/workspace/build/src/clang/bin/clang++ --target=aarch64-linux-android -o e_acos.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/modules/fdlibm/src -I/builds/worker/workspace/build/src/obj-firefox/modules/fdlibm/src -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include/aarch64-linux-android -isystem /builds/worker/workspace/build/src/android-ndk/sysroot/usr/include -gcc-toolchain /builds/worker/workspace/build/src/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -D__ANDROID_API__=21 -Qunused-arguments -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wloop-analysis -Wc++1z-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-sized-deallocation -fno-short-enums -fno-exceptions -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++/include -I/builds/worker/workspace/build/src/android-ndk/sources/android/support/include -I/builds/worker/workspace/build/src/android-ndk/sources/cxx-stl/llvm-libc++abi/include -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -g -Oz -fno-omit-frame-pointer -funwind-tables -Werror -Wno-parentheses -Wno-sign-compare -Wno-dangling-else  -MD -MP -MF .deps/e_acos.o.pp   /builds/worker/workspace/build/src/modules/fdlibm/src/e_acos.cpp
[task 2018-08-10T22:49:29.366Z] 22:49:29     INFO -  make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/modules/fdlibm/src'
[task 2018-08-10T22:49:29.366Z] 22:49:29     INFO -  /builds/worker/workspace/build/src/config/recurse.mk:74: recipe for target 'memory/mozalloc/target' failed
[task 2018-08-10T22:49:29.366Z] 22:49:29     INFO -  make[3]: *** [memory/mozalloc/target] Error 2
Flags: needinfo?(mh+mozilla)
Missing string.h include in mozalloc_abort.cpp
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b2bd723ebc8
Upgrade to Android NDK r17b and API level 16 (JB). r=snorp
https://hg.mozilla.org/mozilla-central/rev/2b2bd723ebc8
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Depends on: 1482797
Duplicate of this bug: 1465468
(In reply to Mike Hommey [:glandium] from comment #6)
> ac_add_options CC=clang

Can we do this by default?  It took me a while to find this solution.
AIUI, it doesn't work for everyone, so no, that can't be used as default. We may want to downgrade the NDK version bootstrap installs, though.
Gah, you are right.  It didn't work for me either. :/  I am going to use a different version of the NDK.
You need to log in before you can comment on or make changes to this bug.