PDA

View Full Version : arm 32-bit build still trying to use arm64 toolchain



aaronouthier
2020-04-16, 02:24
Despite changing the ARCH variable to arm, and SUBARCH to armhf, the build process is still insistent on compiling for arm64 in a few places. Could someone take a look? I have attached my local.config file, and I am trying to compile for https://github.com/lineageos/android_kernel_oppo_msm8974

Am I not setting ARCH properly?

3955

re4son
2020-04-16, 02:38
Exporting all these variables instructs make to compile 64bit using clang.

To only compile in 32bit using the google toolchain you have to unset clang and point "CROSS_COMPILE" to your 32bit toolchains. Here is the config I used to compile a Nexus 5 Kernel:


##############################################
# Toolchains
##############################################

# Clang
unset CLANG_ROOT
unset CLANG_PATH
unset LD_LIBRARY_PATH
unset CLANG_TRIPLE
unset CC


# GCC 32bit
## armhf cross compiler directory:
CCD32="${TD}/armhf-linaro-4.9"
export CROSS_COMPILE=${CCD32}/bin/arm-linux-gnueabihf-
export CROSS_COMPILE_ARM32=${CCD32}/bin/arm-linux-gnueabihf-
## Source repository:
CROSS_COMPILE_ARM32_SRC="https://images.kali.org/nethunter/toolchains/linaro-armhf-4.9.tar.xz"
CROSS_COMPILE_ARM32_TYPE="wget"

# Additional compiler arguments
MAKE_ARGS=""

# Architecture
export ARCH=arm

# Image
IMAGE_NAME=zImage-dtb

# Path to compiled kernel image
KERNEL_IMAGE=$BUILD_DIR/out/arch/arm/boot/$IMAGE_NAME

Hope that helps and please let us know how you go

aaronouthier
2020-04-16, 03:55
~/android_kernel_oppo_msm8974/scripts/gcc-version.sh: line 25: ~/android/toolchains/aarch64-4.9/bin/aarch64-linux-android-gcc: No such file or directory
~/android_kernel_oppo_msm8974/scripts/gcc-version.sh: line 26: ~/android/toolchains/aarch64-4.9/bin/aarch64-linux-android-gcc: No such file or directory
~/android_kernel_oppo_msm8974/scripts/gcc-version.sh: line 25: ~/android/toolchains/aarch64-4.9/bin/aarch64-linux-android-gcc: No such file or directory
~/android_kernel_oppo_msm8974/scripts/gcc-version.sh: line 26: ~/android/toolchains/aarch64-4.9/bin/aarch64-linux-android-gcc: No such file or directory
Using ~/android_kernel_oppo_msm8974 as source for kernel
... ... ...
~/android/toolchains/aarch64-4.9/bin/aarch64-linux-android-gcc: No such file or directory
Is your PATH set correctly?


Copied the oneplus2 config to the local config, and commented out all of the 64-bit clang stuff, and uncommented the relevant 32-bit stuff. I also added export ARCH=arm . Saved, and reran build.sh . Got the above errors when trying option #2. I had already made the kernel config changes as suggested in the Docs, and applied the appropriate patches. I can provide the newlocal.config if needed.

P.S.: I am replacing the name of my home folder with ~/ in the pasted code above. Probably not needed, but you never can be too careful. Hacking forum and all...

aaronouthier
2020-04-16, 03:58
Just realized I missed a few places where my user name was showing. D'oh! Edit complete.

aaronouthier
2020-04-16, 04:06
I'm hoping, if I can get this going, that I would be able to try the new nethunter version, with the USB arsenal?

Is the OnePlus 1 on LineageOS 16 one of the devices you plan to support (yeaaaaah!), or only their stock ROM (boooo!!)

And if I can get it going myself, how would I go about submitting the work to you guys for testing??

I say "get it going myself" with a grain of salt - Re4son has put in almost much time ansering my questions, as I have following the instructions. Oh, well. Everyone has to start somewhere.

re4son
2020-04-16, 04:07
What's your "CROSS_COMPILE" set to?

aaronouthier
2020-04-16, 04:12
What's your "CROSS_COMPILE" set to?


export CROSS_COMPILE_ARM32=${CCD32}/bin/arm-linux-androideabi-

I see in the original code for oneplus 2, that there is a CROSS_COMPILE all by itself, but I have commented that out, since it is for arm64. Going to go over your Nexus 5 code again, to find the correct value for that.

BRB

re4son
2020-04-16, 04:15
Copy local.config.example.hammerhead across and use that. That should work out of the box. The OP2 is arm64 and none of its settings would work for you

aaronouthier
2020-04-16, 04:20
Only errors left now are a few of:



~/android/toolchains/armhf-linaro-4.9/bin/arm-linux-gnueabihf-gcc: No such file or directory
Is your PATH set correctly?


Going to double-check the docs, to see what I missed.

re4son
2020-04-16, 04:21
Is the OnePlus 1 on LineageOS 16 one of the devices you plan to support (yeaaaaah!),
We'd love to but would need your help as we don't have the hardware to develop ot test.


or only their stock ROM (boooo!!)
Not only but as well. We usually provide a "stable" image for the last available stock OS. This one is our favourite because it is stable and available. LOS tends to pull images when they are out of support.
If there is demand and someone willing to develop it, we also release a "latest" image, which is usually for the latest stable LOS version.


And if I can get it going myself, how would I go about submitting the work to you guys for testing??
Raise a merge request and we can help getting it integrated with our build tools. Testing is up to you though because we don't have the hardware to test.

re4son
2020-04-16, 04:25
Going to double-check the docs, to see what I missed
Run setup again to download the new toolchain

Setup only downloads the toolchains defined in the current config. Saves bandwidth and time.

aaronouthier
2020-04-16, 04:32
I do understand you are a small team of developers, but if you guys don't have access to a OnePlus 1, then why is it your recommended device, or do I have out-of-date info?

re4son
2020-04-16, 04:43
Good question. The image has been developed and is stable and there is no reason to pull it or to upgrade it unless OnePlus decides to release a new firmware.

aaronouthier
2020-04-16, 05:19
Ok, major glaring problem. Although everything seems to compile correctly, the resulting zip file does not contain the file zImage.dtb . I have reviewed the documentation, and there is only one section that I was unable to complete, as there was no such option in the menu:



Kernel Image
Our preferred image type is a compressed and concatenated image file if the kernel source permits it:

select “Build a concatenated Image.gz/dtb by default


I do not see a section labled "Kernel Image" anywhere. I would search for the setting "CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE=y", if I knew where was the underlying plain-text config file?

aaronouthier
2020-04-16, 05:26
Nvm, I found the file with the find command. (nethunter_defconfig, which is in ../arch/arm/configs). The option is already set. (Option is named CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE, though).

re4son
2020-04-16, 05:40
Just hit "3" again and when it pauses at the end of the compilation, scroll up a bit until you find the line where it creates the image. That'll tell you the name.

Alternatively, you can do an:


ls out/arch/arm/boot/