Results 1 to 16 of 16

Thread: arm 32-bit build still trying to use arm64 toolchain

  1. #1
    Join Date
    2019-Nov
    Posts
    169

    arm 32-bit build still trying to use arm64 toolchain

    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...l_oppo_msm8974

    Am I not setting ARCH properly?

    local.config.txt

  2. #2
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    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:

    Code:
    ##############################################
    # 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

  3. #3
    Join Date
    2019-Nov
    Posts
    169

    Talking

    Code:
    ~/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...
    Last edited by aaronouthier; 2020-04-16 at 03:57. Reason: I missed a few...

  4. #4
    Join Date
    2019-Nov
    Posts
    169
    Just realized I missed a few places where my user name was showing. D'oh! Edit complete.

  5. #5
    Join Date
    2019-Nov
    Posts
    169
    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.

  6. #6
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    What's your "CROSS_COMPILE" set to?

  7. #7
    Join Date
    2019-Nov
    Posts
    169
    Quote Originally Posted by re4son View Post
    What's your "CROSS_COMPILE" set to?
    Code:
    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

  8. #8
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    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

  9. #9
    Join Date
    2019-Nov
    Posts
    169
    Only errors left now are a few of:

    Code:
    ~/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.

  10. #10
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    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.

    Code:
    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.

    Code:
    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.

  11. #11
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    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.

  12. #12
    Join Date
    2019-Nov
    Posts
    169
    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?

  13. #13
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    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.

  14. #14
    Join Date
    2019-Nov
    Posts
    169
    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:

    Code:
    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?

  15. #15
    Join Date
    2019-Nov
    Posts
    169
    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).

  16. #16
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    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:

    Code:
    ls out/arch/arm/boot/

Similar Threads

  1. Arm cross-compiler toolchain?
    By midnightcoder in forum ARM Archive
    Replies: 1
    Last Post: 2019-07-29, 14:48
  2. Kali on SCB ARM64
    By monmoonmooonmoooon in forum ARM Archive
    Replies: 0
    Last Post: 2015-12-17, 10:21
  3. Replies: 1
    Last Post: 2015-03-02, 10:58
  4. Replies: 0
    Last Post: 2015-02-20, 14:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •