I'm trying to build LineageOS 17.1 for the Xperia XZ2 Compact. I have gotten it to successfully build stock, but now I'm onto optimizing it (mostly just applying patches from a XZ1 Compact repo). These patches are for the XZ1 Compact, which uses the Snapdragon 835, or the MSM8998. The XZ2 Compact uses a Snapdragon 845, or the SDM845. A few of these patches I run into errors when compiling. I'm mostly focusing on Clang since I know that would help with performance and battery. I'm not really sure what the other patches do.
Patch 1:
android_device_sony_lilac/patches/update-clang.patch at lineage-17.1 · Flamefire/android_device_sony_lilac
The error:
Extra context:
displays_str is not in the MSM8998 source. I'm not really sure what it does, but if I remove it, it continues to compile but runs into a different error later on. I also don't want to disable some core functionality related to the display, so I'd rather not remove it. There is updated and different code for the function in LineageOS 18.1 source, but replacing the old code with the new code only results in a different error relating to displays_str.
Error 2:
Extra context:
I have no idea what this means or how to fix it. It would probably be helpful if I captured a bit more in this screenshot, but I didn't. I would prefer to get more info once I get displays_str fixed instead of bypassing it again.
For these patches I will get into less detail, as I don't think it's needed, but if you need it, I can recompile with the patch to get a full error.
Patch 2:
android_device_sony_lilac/patches/fix-llvm-unwind-warning-and-findUnwindSections.patch at lineage-17.1 · Flamefire/android_device_sony_lilac
The compiling error was command not found and suggested replacing -Wno-bitwise-conditional-parentheses (On line 11 in the patch) with -Wno-bitwise-op-parentheses and it just worked. Not sure what it changes or even if that just invalidates the entire patch, but it worked.
Patch 3:
android_device_sony_lilac/patches/suppress-bool-operation-warning.patch at lineage-17.1 · Flamefire/android_device_sony_lilac
The compiling error was again command not found, but had no suggestion for replacing -Wno-bool-operation (On line 12 in the patch). Not sure what this does either. No fix for it (aside from not including) for now.
Patch 4:
android_device_sony_lilac/patches/update-abi-dumps.patch at lineage-17.1 · Flamefire/android_device_sony_lilac
This causes a bunch of errors but the compiler helped me and I was able to fix it with the four commands below.
$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libhidlbase
$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libhwbinder_noltopgo
$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libstagefright_foundation
$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libprotobuf-cpp-full
Again not sure if this just invalidates the patch, but it worked.
I would really appreciate some help with this. I don't really know what I'm doing when it comes to coding.