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.

Modules Compilation error

Hello all,

I am using Ubuntu 16.04 on my PC  and Ubuntu 14.04 on my laptop.

I am trying to customize  Kernel 4.1  for my VAR-SOM-AM33 device that is based on TI AM335x.

I made all the steps according to TI Wiki  page "processors.wiki.ti.com/.../Linux_Kernel_Users_Guide"

I Made the next steps until the error( tried on my PC and on my laptop):

1.Downloading source code

2.Setup Toolchain path (I am in the top-level directory from this step until the error)

3 .Cleaning the Kernel Sources

4. Customizing the Configuration with menuconfig

5.Enable  Device Drivers -> SPI support -> <*> User mode SPI device driver support   in the config menu

5. Compiling the Kernel with the command : "make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage LOADADDR=0x80200000".

6. Compiling the modules with the command  "make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules"  and get the error:

In file included from drivers/net/ethernet/intel/i40e/i40e_adminq.h:32:0,
                 from drivers/net/ethernet/intel/i40e/i40e_type.h:33,
                 from drivers/net/ethernet/intel/i40e/i40e.h:57,
                 from drivers/net/ethernet/intel/i40e/i40e_main.c:28:
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:304:32: warning: division by zero [-Wdiv-by-zero]
  { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
                                ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:1540:1: note: in expansion of macro 'I40E_CHECK_STRUCT_LEN'
 I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data);
 ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:1540:29: error: enumerator value for 'i40e_static_assert_i40e_aqc_configure_partition_bw_data' is not an integer constant
 I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data);
                             ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:304:49: note: in definition of macro 'I40E_CHECK_STRUCT_LEN'
  { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
                                                 ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:304:32: warning: division by zero [-Wdiv-by-zero]
  { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
                                ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:1877:1: note: in expansion of macro 'I40E_CHECK_STRUCT_LEN'
 I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
 ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:1877:28: error: enumerator value for 'i40e_static_assert_i40e_aqc_nvm_config_data_feature' is not an integer constant
 I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
                            ^
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h:304:49: note: in definition of macro 'I40E_CHECK_STRUCT_LEN'
  { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
                                                 ^
scripts/Makefile.build:258: recipe for target 'drivers/net/ethernet/intel/i40e/i40e_main.o' failed
make[5]: *** [drivers/net/ethernet/intel/i40e/i40e_main.o] Error 1
scripts/Makefile.build:403: recipe for target 'drivers/net/ethernet/intel/i40e' failed
make[4]: *** [drivers/net/ethernet/intel/i40e] Error 2
scripts/Makefile.build:403: recipe for target 'drivers/net/ethernet/intel' failed
make[3]: *** [drivers/net/ethernet/intel] Error 2
scripts/Makefile.build:403: recipe for target 'drivers/net/ethernet' failed
make[2]: *** [drivers/net/ethernet] Error 2
scripts/Makefile.build:403: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Error 2
Makefile:947: recipe for target 'drivers' failed
make: *** [drivers] Error 2


I cant find any solution for this error, i searched for two days.

Please, if anyone go through this problem and can help me.

Thanks a lot

Oren



  • Hello oren,

    Could you check if this thread will be in help?

    Best regards,
    Kemal

  • Kemal,

    Thanks a lot for the quick response!

    I saw this thread before i posted my question and i am doing exactly(i think so..) what you write there. i am in the top level directory and make the steps:

    1.cleaning the kernel sources with the command   make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mrproper   or with  the   command  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean.

    2. Customizing the Configuration with menuconfig

    3. Enable  Device Drivers -> SPI support -> <*> User mode SPI device driver support   in the config menu

    4.Compiling the Kernel with the command  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage LOADADDR=0x80200000

    5.Compile the modules with the command  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules  and i got the same Error again...

     

    Its didn't solve the problem.

    Oren

     

  • oren zvuluni said:

    2. Customizing the Configuration with menuconfig

    How you custumize the kernel? Could you post the complete command of step 2?
  • Sure,

    Step 2 - Customizing the Configuration with the command  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig , then a configuration menu open and i choose SPI as described in step 3.

    Oren

  • Does your board have a defconfig file? Have you run a command something like this one below, before running menuconfig?

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig
  • When you write board you mean in the top-level directory?

    In this flow of commands i did not run the command you mention cause i know that it is the default configuration and i need to configure the kernel myself and  add the SPI module.

    the first step is the clean command and right after it i ran  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig  command.

    Oren

  • I Think i understood the question "Does your board have a defconfig file?"
    I checked in /boot directory on my board and there is no /config-4.1.x file, so the config file is not there.
    I also checked in /usr/src directory and there is no /linux-4.1.x directory.

    I Also tried to remove the i40e sources from the compiling process by comments them in the Makefile that located in:
    /drivers/net/ethernet/intel/Makefile
    after i comment them, i tried to compile the modules again and its pass that error point but the compilation failed on something else....

    Thanks,
    Oren
  • If your board doesn't have a specific defconfig file, you can start with the tisdk_am335x-evm_defconfig, which resides in <Processor SDK>/board-support/linux-<version>/arch/arm/configs/ directory
    First enter this command
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig
    then type make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig and Enable Device Drivers -> SPI support -> <*> User mode SPI device driver support in the config menu.

  • Kemal,

    You have solved the problem!

    Thanks a loot!

    I now know the right compilation process and i know what was the problem.

    I always configured the Kernel as default or  i customized it. i needed to first configure it as default and after it to customized it.

    Thanks a lot,

    Oren