[Android Software/Hacking General [Developers Only]] newbit:
yeah good luck with the new kernel source. keep me updated once you finished building it

[Update 29.01.2021]

Hey @ebrahimwaleed,

what is the status? Any progress?

I've created a github repo with your PIE Source and committed some of my changes to it.

I was able to download and extract the defconfig file from the Firmware FullOTA-MF ARS-AL00 9.1.0.160(C00E160R2P5) 2019.12.09

Some changes were necessary to get make starting, like the cfi to n and the cert to the kernel sources cert.

The kernel starts compiling, quite long, but then it breaks with issues I can't figure out to fix.

There is not much more I can do for you, so you have to take it from here. I can't get the missing opensource drivers proper into the source.

I fixed the Kbuild file so far, that it has the right path to it, also some other includes, but the code doesn't match the version/style Huawei used.

There are still some things I figured so far.

the kernel/drivers/wlan_driver is actually qcacld-3.0

in there must be a/the hw_qca_decoupled

fw-api is missing at all but its needed -> athdefs.h, it belongs in drivers or rather the same hierarchy as qcacld-3.0

qca-wifi-host-cmn is in drivers, but it is not complete, i.e. target_if is missing but requested from the Kbuild

the only version hint I could find is in kernel/drivers/wlan_driver/core/mac/inc/qwlan_version.h -> 5.1.1.69P

all this usally belongs in kernel/drivers/staging

checkout some work on that from @nathanchance

I've tried several branches from the codeaurora around Nov 2018 until May 2019. But at the end, there are always too many symbols not known

or the too many warnings regarding the syntax.

I hope it will bring you something further than before.

Here are some commands I used, it might help you to pick up where I left:

mkdir workdir && cd ~/workdir
git clone https://github.com/newbit1/ARES_PIE_EMUI9.1.0_opensource.git Code_Opensource
VER=r17c
wget https://dl.google.com/android/repository/android-ndk-$VER-linux-x86_64.zip
unzip android-ndk-$VER-linux-x86_64.zip android-ndk-$VER/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/*
mv android-ndk-$VER/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 aarch64-linux-android-4.9 && rm -Rf android-ndk-$VER
export CROSS_COMPILE=$(pwd)/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=$(pwd)/aarch64-linux-android-4.9/bin
export PATH=$PATH:$(pwd)/aarch64-linux-android-4.9/bin
cd Code_Opensource/kernel/
make ARCH=arm64 FIRMWARE_sdm660_64_defconfig
make ARCH=arm64 xconfig
make ARCH=arm64 -j$(nproc)
cd ~/workdir/Code_Opensource/kernel/drivers/wlan_driver
cd ~/workdir/Code_Opensource/kernel/vendor/qcom/opensource/wlan/
SDM660BRANCH=LA.UM.7.2.r1-04000-sdm660.0
git clone -b $SDM660BRANCH --single-branch https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn
git clone -b $SDM660BRANCH --single-branch https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0
git clone -b $SDM660BRANCH --single-branch https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/fw-api

Regarding the cfi.so

It seems that the GCC libexec/cc1 is generating or referring to this file on runtime. It is a bit above my head, but this libexec is ment

to access a shared lib path on your host, to files, which are not supposed to be able to run from "normal" users. This could be a reason

why I only get one hit on a forum mentioning the same file cfi.so, even with the same issue I guess, it is in Russian. But that's it, can't find anything

else and don't know what it is really supposed to do. CFI could stand for Code Flow Integration...

Installing GCC: Configuration

Control Flow Integrity

Control Flow Integrity Design Documentation

Cheers

NewBit