0

I' trying to build a kernel for a Sony Xperia Z3 Tablet compact following this guide:

http://developer.sonymobile.com/knowledge-base/open-source/open-devices/how-to-build-and-flash-a-linux-kernel/how-to-build-and-flash-a-linux-kernel-for-aosp-supported-devices/

The error I receive is the following upon make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE -j4

...
  CC      kernel/exec_domain.o
  CC      arch/arm/mach-msm/board-8974-gpiomux.o
  AS      arch/arm/mm/tlb-v7.o
  AS      arch/arm/mm/proc-v7.o
  CC      mm/mempool.o
arch/arm/mach-msm/board-8974-gpiomux.c:692:24: error: 'gpio_spi_config' undeclared here (not in a function)
    [GPIOMUX_ACTIVE] = &gpio_spi_config,
                        ^
  LD      arch/arm/mm/built-in.o
scripts/Makefile.build:308: die Regel für Ziel „arch/arm/mach-msm/board-8974-gpiomux.o“ scheiterte
make[1]: *** [arch/arm/mach-msm/board-8974-gpiomux.o] Fehler 1
Makefile:815: die Regel für Ziel „arch/arm/mach-msm“ scheiterte
make: *** [arch/arm/mach-msm] Fehler 2
make: *** Auf noch nicht beendete Prozesse wird gewartet …
  CC      mm/oom_kill.o
  CC      kernel/panic.o
  CC      kernel/printk.o
  CC      kernel/cpu.o
  CC      mm/fadvise.o
...

as proposed in the HowTo I did following steps:

  1. installed 4.8 cross compile toolchain and exported CROSS_COMPILE var
  2. cloned kernel repository
  3. took aosp_shinano_scorpion_defconfig from aosp repository
  4. updated the config
  5. ran the above mentioned build command

As I could see in the board-8974-gpiomux.c the declaration of the gpio_spi_configstruct is inside an ifdef, but the call where the error occured is outside the scope of the ifdef condition.

So it seems logical to me, that the compiler complains about that. But I also doubt an error in the source, because I'm quite certain that I'm not the first one following that guide.

Any ideas?

Thanks and regards, Timo

TimoG
  • 1
  • 2
  • what is the `#ifdef` checking? Is the condition set `true` in the configuration file? – user3629249 May 01 '16 at 20:36
  • It is checking for `#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)`. Those are not defined in the config file. – TimoG May 02 '16 at 06:54
  • Since those are hardware oriented configuration items, perhaps they should be defined in the configuration file. – user3629249 May 02 '16 at 15:25
  • I think you are right on mentioning that it is hardware-related. But the config file I used was preconfigured for my exact device. And why should the same struct be used in the same file outside the `#ifdef` condition? During build I ran into several other failures in other files. Some of them where just warnings defined as errors such as `'unused-variable'` some where more serious errors such as `missmatching Pointer assignment`. I think their Kernel is buggy. I'm investigatig further. Thanks for your help so far – TimoG May 02 '16 at 16:17

1 Answers1

-1

He is right. In file "board-8974-gpiomux.c" we see "#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)". It means if at least one of these has been enabled then gcc will see the definitions in this section. enabling "CONFIG_KS8851=y" in the config file passed this for me.

noufalcep
  • 3,446
  • 15
  • 33
  • 51