[Fire HD 8 and HD 10 Original Android Development] kingladar:
It's been awhile, so I don't recall what the changes were. And I was about to say your seeing a different problem, until I realized your messages were in Italian.

I cloned the code repos, and committed my fixes. So if you go back in the commit history, and compare, you can probably find the typos. It's been awhile, so I don't recall what state the repositories are in now. I was playing around with a few different configurations, to see if I could I build a ROM with a 64 bit ABI. As I recall I had several versions building just fine, but was having trouble getting them to boot.

I have several build scripts, based on the different I was trying, and I don't recall which version booted properly. But this one looks to be simplest. FYI, I was using a Vagrant box (aka virtual machine) setup to build Lineage, which made it a little easier. If you want to try using that environment, it might help. The virtual machines can be downloaded from here: https://vagrantcloud.com/lineage/

Or if you Vagrant setup, run:

vagrant init lineage/lineage && vagrant up && vagrant ssh

You may need to add the "--provider=HYPERVISOR" to the `vagrant up` command. There are VMs for different platforms. Anyways, once your inside the vm, try running this sript:

#!/bin/bash -e
cd $HOME && rm -rf linaro_manifest.xml device_manifest.xml android-build.log .gitconfig .repo_.gitconfig.json .repoconfig/ .gnupg/ .cache/ android/ cache/ temp/ && sudo sync
mkdir -p $HOME/temp && mkdir -p $HOME/cache && mkdir -p $HOME/android/lineage
cat <<-EOF > $HOME/device_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!-- Device Trees -->
<project name="craptastic-droids/android_device_amazon_karnak" path="device/amazon/karnak" remote="github" revision="lineage-18.1"/>

<!-- Kernel Sources -->
<project name="craptastic-droids/android_kernel_amazon_karnak" path="kernel/amazon/karnak" remote="github" revision="lineage-18.1"/>
<project name="craptastic-droids/android_kernel_mediatek_mt8163" path="kernel/mediatek/mt8163/4.9" remote="github" revision="lineage-17.1"/>

<!-- Vendor Trees -->
<project name="craptastic-droids/android_vendor_amazon_karnak" path="vendor/amazon/karnak" remote="github" revision="lineage-18.1"/>
<project name="craptastic-droids/android_vendor_amazon_mt8163" path="vendor/amazon/mt8163" remote="github" revision="lineage-18.1"/>
<project name="craptastic-droids/android_vendor_raffy" path="vendor/raffy" remote="github" revision="lineage-18.1"/>
</manifest>
EOF
cd $HOME/android/lineage
git config --global user.name "Ladar Levison"
git config --global user.email "ladar@lavabit.com"
git config --global color.ui false
repo init -u git://github.com/LineageOS/android.git -b lineage-18.1
mkdir -p .repo/local_manifests/
mv $HOME/device_manifest.xml .repo/local_manifests/device_manifest.xml
repo sync --jobs=32 --current-branch --no-clone-bundle --no-tags || exit 1

# GCC 7.5.0
mkdir -p prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/
curl -L -o $HOME/gcc-linaro-7.5.0-x86_64_aarch64-linux-gnu.tar.xz https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
echo "3b6465fb91564b54bbdf9578b4cc3aa198dd363f7a43820eab06ea2932c8e0bf $HOME/gcc-linaro-7.5.0-x86_64_aarch64-linux-gnu.tar.xz" | sha256sum -c || exit 1
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/gcc-linaro-7.5.0-x86_64_aarch64-linux-gnu.tar.xz
rm -f $HOME/gcc-linaro-7.5.0-x86_64_aarch64-linux-gnu.tar.xz

export LANG=en_US.UTF-8
export TMPDIR="$HOME/temp"
export USE_CCACHE=1
export CCACHE_COMPRESS=1
export BUILD_UUID=$(uuidgen)
export CCACHE_DIR="$HOME/cache"
export BUILDSTAMP=`date --utc +'%Y%m%d'`
export CCACHE_EXEC="prebuilts/misc/linux-x86/ccache/ccache"
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G"
# export ANDROID_JACK_EXTRA_ARGS="--verbose debug --sanity-checks on -D sched.runner=single-threaded"

#####
export PYTHONDONTWRITEBYTECODE=true
export BUILD_ENFORCE_SELINUX=1
export OVERRIDE_TARGET_FLATTEN_APEX=true
# convert this to a runtime check, grep "sse4_2.*popcnt" /proc/cpuinfo
export CPU_SSE42=false
#####

source build/envsetup.sh
if [ ! -x "$CCACHE_EXEC" ]; then
export CCACHE_EXEC="$(which ccache)"
fi
"$CCACHE_EXEC" -M 1G

rm -rf out
breakfast lineage_karnak-userdebug
export OVERRIDE_TARGET_FLATTEN_APEX=true
# mka otatools-package target-files-package dist 2>&1 | tee -a $HOME/android-build.log
cmka bacon 2>&1 | tee -a $HOME/android-build.log

You might want to avoid running this, as is, on your host, as it wipes out a bunch of directories before each build to ensure it starts from the same clean state. I also spent time playing with different toolchains. This script uses v7.5.0 of the linaro toolchain. It seemed to be the newest version that seemed to work relatively well. but beware, you may need to make tweaks to the code, depending on which version you pick.

Here are the relevan blocks scripting fu for other tool chain versions. You can swap out the relevant block from the script above, with that works best.

# GCC 4.9.4
mkdir -p prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/
curl -L -o $HOME/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz https://releases.linaro.org/components/toolchain/binaries/latest-4/aarch64-linux-gnu/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz
echo "d1f2761b697e6b49f5db1ec0cd48d2fd98224be8cb5ef182093f691e99c923eb $HOME/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz" | sha256sum -c || exit 1
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz
rm -f $HOME/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz

# GCC 5.5.0
mkdir -p prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/
curl -L -o $HOME/gcc-linaro-5.5.0_x86_64_aarch64-linux-gnu.tar.xz https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch64-linux-gnu/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu.tar.xz
echo "fa8c3a400f281fb7a62db267fd51f0a02fb43aa8b91701192a7ce040573866fb $HOME/gcc-linaro-5.5.0_x86_64_aarch64-linux-gnu.tar.xz" | sha256sum -c || exit 1
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/gcc-linaro-5.5.0_x86_64_aarch64-linux-gnu.tar.xz
rm -f $HOME/gcc-linaro-5.5.0_x86_64_aarch64-linux-gnu.tar.xz

# GCC 6.5.0
mkdir -p prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/
curl -L -o $HOME/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu.tar.xz https://releases.linaro.org/components/toolchain/binaries/6.5-2018.12/aarch64-linux-gnu/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu.tar.xz
echo "63e35c43452bca1761751ab7a6af35d88b8f36a8f906c12e4dd284a06309d37f $HOME/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu.tar.xz" | sha256sum -c || exit 1
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu.tar.xz
rm -f $HOME/gcc-linaro-6.5.0-2018.12-x86_64_aarch64-linux-gnu.tar.xz

## These tool chains use a different structure, so they may not work properly without effort.
# GCC 11.2.1
mkdir -p prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/
curl -L -o $HOME/gcc-linaro-11.2.1-aarch64-linux-gnu.tar.xz https://snapshots.linaro.org/gnu-toolchain/11.2-2022.01-1/aarch64-linux-gnu/gcc-linaro-11.2.1-2022.01-x86_64_aarch64-linux-gnu.tar.xz
echo "550bb186ce4dc1f5629c29307d254a2022600eefa03422b1a3c9f4b6172c2592 $HOME/gcc-linaro-11.2.1-aarch64-linux-gnu.tar.xz" | sha256sum -c || exit 1
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/gcc-linaro-11.2.1-aarch64-linux-gnu.tar.xz
rm -f $HOME/gcc-linaro-11.2.1-aarch64-linux-gnu.tar.xz
curl -L -o $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz https://snapshots.linaro.org/gnu-toolchain/11.2-2022.01-1/aarch64-linux-gnu/sysroot-glibc-linaro-2.34-2022.01-aarch64-linux-gnu.tar.xz
echo "ead1da3a3b4df162f4355f195ae816a097ab7ae60b1633f85d887cc6ac0a70aa $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz" | sha256sum -c
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz
rm -f $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz

# GCC 12.0.0
mkdir -p prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/
curl -L -o $HOME/gcc-linaro-12.0.0-aarch64-linux-gnu.tar.xz https://snapshots.linaro.org/gnu-toolchain/12.0-2022.01-1/aarch64-linux-gnu/gcc-linaro-12.0.0-2022.01-x86_64_aarch64-linux-gnu.tar.xz
echo "df554a8090f11fd526e55d2c7c5a8afc24194972cd02927022960aec9ac882b7 $HOME/gcc-linaro-12.0.0-aarch64-linux-gnu.tar.xz" | sha256sum -c || exit 1
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/gcc-linaro-12.0.0-aarch64-linux-gnu.tar.xz
rm -f $HOME/gcc-linaro-12.0.0-aarch64-linux-gnu.tar.xz
curl -L -o $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz https://snapshots.linaro.org/gnu-toolchain/12.0-2022.01-1/aarch64-linux-gnu/sysroot-glibc-linaro-2.34.9000-2022.01-aarch64-linux-gnu.tar.xz
echo "ce929cd8dac1cca2572004b305861e32ee381c080a99250632d49fafe6b468c9 $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz" | sha256sum -c
tar -x -J -v --strip-components=1 -C prebuilts/linaro/linux-x86/aarch64/aarch64-linux-gnu/ -f $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz
rm -f $HOME/sysroot-glibc-linaro-2.34-aarch64-linux-gnu.tar.xz

If you manage to get things running solid, please submit a pull request back to my repos on GitHub, and/or send me any changes to the build script.

Have fun!