This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5749/Can't compile kernel

Other Parts Discussed in Thread: AM5749

Hello Support!!

I would like to use cross compilation on my host machine based on Ubuntu 18.04 (how I can see in: software-dl.ti.com/.../Processor_SDK_Linux_Getting_Started_Guide.html )

1.I download: ti-processor-sdk-linux-am57xx-evm-06.03.00.106

2.execute setup.sh script

I don't would like use topMake and I change dir:  <SDK>/board-support/linux-4.19.94+gitAUTOINC+be5389fd85-gbe5389fd85

2. I download make utility.

3. then I do this : sudo ARCH=arm make defconfig KBUILD_DEFCONFIG=tisdk_am57xx-evm_defconfig

I get .config file in this directory then I would like to build kernel use simple commands

I do: sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

And I see : /bin/sh: 1: arm-linux-gnueabihf-gcc: not found

So I have a question ..If I have a Cross compiller in SDK which located in: <SDK>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/

why I can't use it (I am almost sure the problem with some variables but I cant understand what I need exactly and why Ubuntu didn't see this compiler).

So could you guide me step by step what I should to do for successful compilation of kernel.

Best Regards,

Oleg

  • Hi Oleg,

    The toolchain needs to be in your PATH environment variable. Try adding <SDK>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/ to your PATH.

    Alternatively, you could use the top level makefiles just to build certain components
    https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/Overview/Top_Level_Makefile.html


    Regards,
    Vishal

  • Hello Vishal,

    I did it: export PATH=”<SDK INSTALL DIR>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:$PATH”

    then I checked environment variable and I see it was added ...but it is still doesn't work.

    It is looks like my host maschine didn't see compiller.

    Regards,
    Oleg

  • Hi Oleg,

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- omap2plus_defconfig
    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- zImage

    I was able to get compilation going.

    New compiler has '-none' in between arm & linux. Just check that it should be straightforward.

    - Keerthy

  • Hi Keerthy,

    It is still does't work...Ok.. could you give me exact link for a right compiller which do you use for Building Kernel for AM5749..I will try to install it and try again...

    Or do you mean this one: gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf

    Maybe I did something wrong or missunderstood User guide(I was almost sure about the compiller is located in SDK directory).

  • Hi Oleg,

    I am trying what you tried but gave the compiler path directly in the command:

    Can you try this from the linux folder:

    make ARCH=arm CROSS_COMPILE=../../linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf- zImage

    Does that work for you?

    - Keerthy

  • Hi Keerthy,

    Yep.. you are right it is work! Kernel is compilled, but:

    1.Why I can't use short form: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-(I think I loose some enviroment variables or something like that.)

    2. I am wory abot another one thing..when I try to execute: make menuconfig. I saw another compiller: Compiler: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0(but it should be for example this one: Compiler: arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0).

    Actualy it is right method... I menan configuration kernel throught menuconfig or the same utils.

    -Oleg

  • Oleg,

    I added my toolchain path to $PATH

    echo $PATH

    /home/keerthy/work/ti-processor-sdk-linux-automotive-j7-evm-07_00_01/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:/home/keerthy/work/ti-processor-sdk-linux-am57xx-evm-06.03.00.106/linux-devkit/sysroots/x86_64-arago-linux/usr/bin

    Now i am able to compile with the following command:

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

    Both of the above worked well.

    You can query the version of arm compiler using:

    arm-linux-gnueabihf-gcc --version

    Output: "arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

    Just recheck your path in case you have multiple versions of arm compiler. This is pretty simple to fix.

    Please resolve the issue if it works for you.


    Best Regards,
    Keerthy

  • Keerthy,

    I dont know what was that  but now I see my compiller when I use: arm-linux-gnueabihf-gcc --version

    It is work unstable.. somtimes I can see compiler sometimes no..

    arm-linux-gnueabihf-gcc --version
    arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0
    Copyright (C) 2018 Free Software Foundation, Inc.

    but when I try to use:

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage

    I see:

    scripts/kconfig/conf  --syncconfig Kconfig

    *** Error during sync of the configuration.

    scripts/kconfig/Makefile:69: recipe for target 'syncconfig' failed
    make[2]: *** [syncconfig] Error 1
    Makefile:534: recipe for target 'syncconfig' failed
    make[1]: *** [syncconfig] Error 2
    Makefile:633: recipe for target 'include/config/auto.conf.cmd' failed
    make: *** [include/config/auto.conf.cmd] Error 2

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

    I see:

    /bin/sh: 1: arm-linux-gnueabihf-gcc: not found
    /bin/sh: 1: arm-linux-gnueabihf-gcc: not found
    scripts/kconfig/mconf  Kconfig
    ./scripts/gcc-version.sh: 26: ./scripts/gcc-version.sh: arm-linux-gnueabihf-gcc: not found
    ./scripts/gcc-version.sh: 27: ./scripts/gcc-version.sh: arm-linux-gnueabihf-gcc: not found
    ./scripts/gcc-version.sh: 29: ./scripts/gcc-version.sh: arm-linux-gnueabihf-gcc: not found
    ./scripts/gcc-version.sh: 26: ./scripts/gcc-version.sh: arm-linux-gnueabihf-gcc: not found
    ./scripts/gcc-version.sh: 27: ./scripts/gcc-version.sh: arm-linux-gnueabihf-gcc: not found
    ./scripts/gcc-version.sh: 29: ./scripts/gcc-version.sh: arm-linux-gnueabihf-gcc: not found
    init/Kconfig:17: syntax error
    init/Kconfig:16: invalid option
    ./scripts/clang-version.sh: 15: ./scripts/clang-version.sh: arm-linux-gnueabihf-gcc: not found
    ./scripts/gcc-plugin.sh: 11: ./scripts/gcc-plugin.sh: arm-linux-gnueabihf-gcc: not found
    scripts/kconfig/Makefile:29: recipe for target 'menuconfig' failed
    make[1]: *** [menuconfig] Error 1
    Makefile:534: recipe for target 'menuconfig' failed
    make: *** [menuconfig] Error 2

    I tried to download another one compiller  and it is work much more stable :

    arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-1ubuntu1~18.04) 8.4.0
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    but I should to change something in a make file which located in linux directory

    # Make variables (CC, etc...)
    AS        = $(CROSS_COMPILE)as
    LD        = $(CROSS_COMPILE)ld
    CC        = $(CROSS_COMPILE)gcc-8
    CPP        = $(CC) -E
    AR        = $(CROSS_COMPILE)gcc-ar-8
    NM        = $(CROSS_COMPILE)gcc-nm-8

    Best Regards,
    Oleg

  • Keerthy,

    When I wanna call clean, or mrproper I should use :

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mrproper

    ???

    Best Regards,
    Oleg