[Sony Xperia XZ Premium ROMs, Kernels, Recoveries, ] LSS4181:
Intermittent reboots. Also, any guide in building on Arch-based distro?

Previously I mentioned about reboots whenever I attempt to unlock the screen right after the screen turned off (It happened 4 out of 5 times under such circumstances). It seems those reboots can happen under some other circumstances as well, and one time it rebooted when I tried to back things up using Titanium Backup, rendered the 256GB SD card unable to be recognized (dirty), that I have to take the SD card out, plug it to a Windows PC, fsck it, then put it back in so the SD card can be properly mounted. Interestingly, despite there were apparent errors on the card, Windows, Linux and TWRP could all still able to mount the card properly, without prompting me to fsck it.

The random reboot issue only happened since today. Not sure what's causing the issue, but I'm suspecting potential overheating or voltage-related issues, as with Treble GSI, the phone feels a bit warmer than usual (compared to stock OEM based CarbonROM). This Snapdragon 835 powered phone rarely reach too hot anyway (compared to my previous phones).

EDIT: I'd love to try Descendant but unfortunately it doesn't seem to boot (apparently it seems some GSIs require flashing and booting Phh-Treble v109 before flashing the actual GSI, so not sure if this is also the case). I could build Descendant myself, but the resulted image is completely unusable, despite bootable, thanks to the tons of warnings I've been seeing (I'm building on Manjaro which is Arch-based, and I never had any problem building CarbonROM 6.1 with the help of ScriBt).

Had anyone succeeded in building a working AOSP build on Arch-based distro recently? Here are some warnings I had during build process. Could that be because the distro's compilers are too new for the purpose? (But AOSP is actually shipping some prebuilt toolchains so it should behave the same regardless of distro... no idea why).

Some type missing warnings:

Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v4/view/accessibility/AccessibilityNodeInfoCompat$CollectionItemInfoCompat.class:
Type `android.view.accessibility.AccessibilityNodeInfo$CollectionItemInfo` was not found, it is required for default or static interface methods desugaring of `android.support.v4.view.accessibility.AccessibilityNodeInfoCompat$CollectionItemInfoCompat android.support.v4.view.accessibility.AccessibilityNodeInfoCompat$CollectionItemInfoCompat.obtain(int, int, int, int, boolean, boolean)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/preference/ContactsPreferences.class:
Type `android.provider.Settings$System` was not found, it is required for default or static interface methods desugaring of `void com.android.contacts.preference.ContactsPreferences.maybeMigrateSystemSettings()`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/model/account/BaseAccountType.class:
Type `android.provider.ContactsContract$CommonDataKinds$Event` was not found, it is required for default or static interface methods desugaring of `com.android.contacts.model.account.AccountType$EditType com.android.contacts.model.account.BaseAccountType.buildEventType(int, boolean)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v4/widget/NestedScrollView.class:
Type `android.view.FocusFinder` was not found, it is required for default or static interface methods desugaring of `boolean android.support.v4.widget.NestedScrollView.executeKeyEvent(android.view.KeyEvent)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/vcard/VCardParserImpl_V21$CustomBufferedReader.class:
Type `java.io.BufferedReader` was not found, it is required for default or static interface methods desugaring of `java.lang.String com.android.vcard.VCardParserImpl_V21$CustomBufferedReader.readLine()`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v7/widget/AppCompatRatingBar.class:
Type `android.widget.RatingBar` was not found, it is required for default or static interface methods desugaring of `void android.support.v7.widget.AppCompatRatingBar.onMeasure(int, int)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/preference/AboutPreferenceFragment.class:
Type `android.preference.PreferenceFragment` was not found, it is required for default or static interface methods desugaring of `void com.android.contacts.preference.AboutPreferenceFragment.onCreate(android.os.Bundle)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v7/widget/ScrollingTabContainerView.class:
Type `android.widget.HorizontalScrollView` was not found, it is required for default or static interface methods desugaring of `void android.support.v7.widget.ScrollingTabContainerView.onMeasure(int, int)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v4/app/BackStackRecord.class:
Type `java.lang.reflect.Modifier` was not found, it is required for default or static interface methods desugaring of `void android.support.v4.app.BackStackRecord.doAddOp(int, android.support.v4.app.Fragment, java.lang.String, int)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v7/widget/AppCompatCheckBox.class:
Type `android.widget.CheckBox` was not found, it is required for default or static interface methods desugaring of `void android.support.v7.widget.AppCompatCheckBox.setButtonDrawable(android.graphics.drawable.Drawable)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/compat/PhoneNumberUtilsCompat.class:
Type `android.text.Spannable$Factory` was not found, it is required for default or static interface methods desugaring of `java.lang.CharSequence com.android.contacts.compat.PhoneNumberUtilsCompat.createTtsSpannableInternal(java.lang.CharSequence)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v4/graphics/TypefaceCompatApi21Impl.class:
Type `android.system.Os` was not found, it is required for default or static interface methods desugaring of `java.io.File android.support.v4.graphics.TypefaceCompatApi21Impl.getFile(android.os.ParcelFileDescriptor)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v4/graphics/TypefaceCompatApi21Impl.class:
Type `android.system.OsConstants` was not found, it is required for default or static interface methods desugaring of `java.io.File android.support.v4.graphics.TypefaceCompatApi21Impl.getFile(android.os.ParcelFileDescriptor)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/ContactPhotoManagerImpl$LoaderThread.class:
Type `android.provider.ContactsContract` was not found, it is required for default or static interface methods desugaring of `void com.android.contacts.ContactPhotoManagerImpl$LoaderThread.loadThumbnails(boolean)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/interactions/CalendarInteractionUtils.class:
Type `android.text.format.DateUtils` was not found, it is required for default or static interface methods desugaring of `java.lang.String com.android.contacts.interactions.CalendarInteractionUtils.getDisplayedDatetime(long, long, long, java.lang.String, boolean, android.content.Context)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:com/android/contacts/ContactPhotoManagerImpl$LoaderThread.class:
Type `android.net.TrafficStats` was not found, it is required for default or static interface methods desugaring of `void com.android.contacts.ContactPhotoManagerImpl$LoaderThread.loadUriBasedPhotos()`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/v7/widget/AppCompatButton.class:
Type `android.widget.Button` was not found, it is required for default or static interface methods desugaring of `void android.support.v7.widget.AppCompatButton.setBackgroundResource(int)`
Warning in out/target/common/obj/APPS/Contacts_intermediates/dex/d8_input.jar:android/support/graphics/drawable/AnimatorInflaterCompat.class:
Type `android.animation.Keyframe` was not found, it is required for default or static interface methods desugaring of `android.animation.Keyframe android.support.graphics.drawable.AnimatorInflaterCompat.createNewKeyframe(android.animation.Keyframe, float)`

Some C/C++ warnings:

[ 19% 20746/104389] //external/e2fsprogs/lib/blkid:libext2_blkid clang probe.c [linux_glibc]
external/e2fsprogs/lib/blkid/probe.c:1517:30: warning: passing 'char [128]' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
unicode_16le_to_utf8(utf8_label, sizeof(utf8_label), label->name, label->length * 2);
^~~~~~~~~~
external/e2fsprogs/lib/blkid/probe.c:1163:49: note: passing argument to parameter 'str' here
static void unicode_16le_to_utf8(unsigned char *str, int out_len,
^
external/e2fsprogs/lib/blkid/probe.c:1524:14: warning: passing 'uuid_t' (aka 'unsigned char [16]') to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
snprintf(uuid, sizeof (uuid), "%02hhX%02hhX-%02hhX%02hhX",
^~~~
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/x86_64-linux-gnu/bits/stdio2.h:70:29: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
^~~
external/e2fsprogs/lib/blkid/probe.c:1527:52: warning: passing 'uuid_t' (aka 'unsigned char [16]') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
blkid_set_tag(probe->dev, "UUID", uuid, strlen(uuid));
^~~~
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/string.h:399:37: note: passing argument to parameter '__s' here
extern size_t strlen (__const char *__s)
^
external/e2fsprogs/lib/blkid/probe.c:1527:39: warning: passing 'uuid_t' (aka 'unsigned char [16]') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
blkid_set_tag(probe->dev, "UUID", uuid, strlen(uuid));
^~~~
external/e2fsprogs/lib/blkid/blkidP.h:177:17: note: passing argument to parameter 'value' here
const char *value, const int vlength);
^
4 warnings generated.

[ 83% 87228/104389] //system/keymaster:libsoftkeymasterdevice clang++ contexts/soft_keymaster_logger.cpp
In file included from system/keymaster/contexts/soft_keymaster_logger.cpp:23:
system/core/libcutils/include_vndk/cutils/log.h:38:2: warning: "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h" [-W#warnings]
#warning "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h"
^
1 warning generated.

[ 90% 94281/104389] //external/compiler-rt:libcompiler_rt clang lib/builtins/arm/comparesf2.S [arm]
external/compiler-rt/lib/builtins/arm/comparesf2.S:99:5: warning: applying IT instruction to more than one subsequent instruction is deprecated
ite ls
^
external/compiler-rt/lib/builtins/arm/comparesf2.S:128:5: warning: applying IT instruction to more than one subsequent instruction is deprecated
ite ls
^
external/compiler-rt/lib/builtins/arm/comparesf2.S:142:5: warning: applying IT instruction to more than one subsequent instruction is deprecated
ite ls
^
[ 91% 95314/104389] //external/scrypt:libscrypt_static clang lib/crypto/crypto_scrypt-neon.c [arm]
external/scrypt/lib/crypto/crypto_scrypt-neon.c:138:20: warning: unused variable 'X32' [-Wunused-variable]
uint32_t * X32 = (void *)X;
^
external/scrypt/lib/crypto/crypto_scrypt-neon.c:140:16: warning: unused variable 'k' [-Wunused-variable]
size_t k;
^
external/scrypt/lib/crypto/crypto_scrypt-neon.c:228:15: warning: implicit declaration of function 'posix_memalign' is invalid in C99 [-Wimplicit-function-declaration]
if ((errno = posix_memalign(&B0, 64, 128 * r * p)) != 0)
^
3 warnings generated.
[ 91% 95318/104389] //external/scrypt:libscrypt_static clang lib/crypto/crypto_scrypt-neon.c
external/scrypt/lib/crypto/crypto_scrypt-neon.c:138:20: warning: unused variable 'X32' [-Wunused-variable]
uint32_t * X32 = (void *)X;
^
external/scrypt/lib/crypto/crypto_scrypt-neon.c:140:16: warning: unused variable 'k' [-Wunused-variable]
size_t k;
^
2 warnings generated.

These are just a tiny fraction of those warnings... not sure if others are seeing as many warnings as I am...