Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Zenfone 2 kernel compilation

sayeed_a_
Beginner
378 Views

While compiling zenfone 2 kernel with icc, I am facing compilation terminated and the the reason for that is "type qualifiers are meaningless in this declaration" this warning refers to https://github.com/Zenfone2-Dev/kernel-FlareM/blob/cm-13.0/include/asm-generic/sections.h#L23

the compilation terminates for the following file : https://github.com/Zenfone2-Dev/kernel-FlareM/blob/cm-13.0/drivers/external_drivers/intel_media/graphics/dfrgx/df_rgx.c

and : https://github.com/Zenfone2-Dev/kernel-FlareM/blob/cm-13.0/sound/soc/intel/board/merr_dpcm_rt5647.c

any help regarding this will be really helpful

regards

Sayeed Afridi

0 Kudos
2 Replies
Melanie_B_Intel
Employee
378 Views

It would help if you could paste your compiler invocation line, and also the message.

I am guessing that the compiler invocation line contains the option -Werror. This causes all warnings to be issued as error diagnostics. The Intel compiler does not have warning-for-warning compatibility with gcc (we try, but it's very complicated).

Since you know that the code you're compiling has been validated with gcc, it would be reasonable to suppress the -Werror option. You can do this by adding -Wno-error to the compile line.

The Intel compiler has an environment variable where you can put options which apply to every compilation. Quoting from the documentation "Command line options can be inserted in the “prefix” position using the __INTEL_PRE_CFLAGS environment variable or in the postfix position using the __INTEL_POST_CFLAGS environment variable. "

Therefore:  % export __INTEL_POST_CFLAGS="-Wno-error"

Hope this helps. --Melanie

0 Kudos
sayeed_a_
Beginner
378 Views

I figured the  quantifier part out. this related to the recent changes made in the kernel update. Here is the link for that : https://github.com/Zenfone2-Dev/kernel-FlareM/commit/6973a89c0c59d6779fe1b5d37d20a76c25e43c56

reverting this commit allows me to get past the quantifier issues. Now I am facing a new issue, this issue can actually be resolved if we had a kernel version greater than 3.14 (if I am right), but asus provides us with 3.10.20 (I have updated it to 3.10.101), linus torvald pushed changes to remove and fix a very bad error : variable "flags" is used before its value is set

here's the reference change made by linus : https://lkml.org/lkml/2012/10/27/71

GCC can handle this well, icc throws error at this line : https://github.com/Zenfone2-Dev/kernel-FlareM/blob/6973a89c0c59d6779fe1b5d37d20a76c25e43c56/include/linux/mm.h#L346

a simple sweet fix is to just take the variable flags as unsigned long flags = 0;

but, this destroys a lot of thing, like we have section mismatch after doing this (I am not sure if this happens due to this or is it already having section mismatch).

the way I am compiling the android kernel is : make ARCH=x86_64 -j4 CC="/home/cyborg/intel/bin/icc -fno-PIC -falign-stack=assume-4-byte -wd858 -wd23,144,167,188,556,1292,1419,10006,10148,10156,10159 -diag-disable 2,23,47,1419,311,147,175 -mno-sse -mno-sse2 -no-alias-const -Wno-ignored-qualifiers" bzImage

this command is used after I have initialized the environment.

here's the section mismatch warnings :

WARNING: vmlinux.o(.text+0xb773c4): Section mismatch in reference from the function mip_rpmsg_probe() to the function .init.text:scu_mip_init()
The function mip_rpmsg_probe() references
the function __init scu_mip_init().
This is often because mip_rpmsg_probe lacks a __init
annotation or the annotation of scu_mip_init is wrong.

WARNING: vmlinux.o(.text+0xb83a46): Section mismatch in reference from the function mid_pb_rpmsg_probe() to the function .init.text:mid_pb_module_init()
The function mid_pb_rpmsg_probe() references
the function __init mid_pb_module_init().
This is often because mid_pb_rpmsg_probe lacks a __init
annotation or the annotation of mid_pb_module_init is wrong.

WARNING: vmlinux.o(.text+0xb83d96): Section mismatch in reference from the function pmic_charger_rpmsg_probe() to the function .init.text:pmic_charger_module_init()
The function pmic_charger_rpmsg_probe() references
the function __init pmic_charger_module_init().
This is often because pmic_charger_rpmsg_probe lacks a __init
annotation or the annotation of pmic_charger_module_init is wrong.

WARNING: vmlinux.o(.cpuinit.text+0xac5): Section mismatch in reference from the function eager_fpu_init() to the function .init.text:eager_fpu_init_bp()
The function __cpuinit eager_fpu_init() references
a function __init eager_fpu_init_bp().
If eager_fpu_init_bp is only used by eager_fpu_init then
annotate eager_fpu_init_bp with a matching annotation.

WARNING: vmlinux.o(.cpuinit.text+0xb56): Section mismatch in reference from the function xsave_init() to the function .init.text:xstate_enable_boot_cpu()
The function __cpuinit xsave_init() references
a function __init xstate_enable_boot_cpu().
If xstate_enable_boot_cpu is only used by xsave_init then
annotate xstate_enable_boot_cpu with a matching annotation.

WARNING: vmlinux.o(.cpuinit.text+0xb72): Section mismatch in reference from the function xsave_init() to the function .init.text:xstate_enable_boot_cpu()
The function __cpuinit xsave_init() references
a function __init xstate_enable_boot_cpu().
If xstate_enable_boot_cpu is only used by xsave_init then
annotate xstate_enable_boot_cpu with a matching annotation.

 

and here's the issues caused by directly taking flags=0;

  GEN     .version
  CHK     include/generated/compile.h
arch/x86/pci/built-in.o: In function `check_mcfg_resource':
/home/cyborg/zenfone/kernel-FlareM/arch/x86/pci/mmconfig-shared.c:395: undefined reference to `acpi_resource_to_address64'
arch/x86/pci/built-in.o: In function `find_mboard_resource':
/home/cyborg/zenfone/kernel-FlareM/arch/x86/pci/mmconfig-shared.c:414: undefined reference to `acpi_walk_resources'
arch/x86/pci/built-in.o: In function `is_acpi_reserved':
/home/cyborg/zenfone/kernel-FlareM/arch/x86/pci/mmconfig-shared.c:431: undefined reference to `acpi_get_devices'
/home/cyborg/zenfone/kernel-FlareM/arch/x86/pci/mmconfig-shared.c:434: undefined reference to `acpi_get_devices'
make: *** [vmlinux] Error 1


any help in this will be appreciated :)

regards

Sayeed Afridi

 

 

0 Kudos
Reply