Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

(Cross)Compiling a kernel for Pcduino3?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
nidzo
Posts: 3
Joined: 2017-08-14 04:39

(Cross)Compiling a kernel for Pcduino3?

#1 Post by nidzo »

Hello all,
I am not new to linux but a bit of a new to Debian. I am trying to compile a kernel for my Pcduino3 on Debian on my PC (Intel) but I am runing into some problems. Here is what the console spits out after I try to run "make".

Code: Select all

make

Submodule 'cedarx-libs' (https://github.com/linux-sunxi/cedarx-libs.git) registered for path 'cedarx-libs'
Submodule 'linux-sunxi' (https://github.com/linux-sunxi/linux-sunxi.git) registered for path 'linux-sunxi'
Submodule 'sunxi-tools' (https://github.com/linux-sunxi/sunxi-tools.git) registered for path 'sunxi-tools'
Submodule 'u-boot-sunxi' (https://github.com/linux-sunxi/u-boot-sunxi.git) registered for path 'u-boot-sunxi'
Cloning into '/root/download/a20-kernel/linux-sunxi'...
Submodule path 'linux-sunxi': checked out '0c92978520e9576a0631da949c13e79bae846494'
Cloning into '/root/download/a20-kernel/u-boot-sunxi'...
Submodule path 'u-boot-sunxi': checked out '87ca6dc0262d18b76e4749fc6505ef596039656a'
apply patch...
make[1]: Entering directory '/root/download/a20-kernel/u-boot-sunxi'
Configuring for pcDuino3 - Board: sun7i, Options: PCDUINO3,SPL
make[1]: Leaving directory '/root/download/a20-kernel/u-boot-sunxi'
make[1]: Entering directory '/root/download/a20-kernel/u-boot-sunxi'
  GEN     include/autoconf.mk.dep
  GEN     include/autoconf.mk
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
  CHK     include/config/uboot.release
  GEN     /root/download/a20-kernel/build/pcduino3-u-boot/Makefile
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  scripts/basic/fixdep
  UPD     include/config/uboot.release
  Using /root/download/a20-kernel/u-boot-sunxi as source for u-boot
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CC      arch/arm/lib/asm-offsets.s
  CC      lib/asm-offsets.s
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94,
                 from /root/download/a20-kernel/u-boot-sunxi/lib/asm-offsets.c:15:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
/root/download/a20-kernel/u-boot-sunxi/./Kbuild:34: recipe for target 'lib/asm-offsets.s' failed
make[3]: *** [lib/asm-offsets.s] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/lib/asm-offsets.c:15:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
/root/download/a20-kernel/u-boot-sunxi/./Kbuild:83: recipe for target 'arch/arm/lib/asm-offsets.s' failed
make[3]: *** [arch/arm/lib/asm-offsets.s] Error 1
/root/download/a20-kernel/u-boot-sunxi/Makefile:1018: recipe for target 'prepare0' failed
make[2]: *** [prepare0] Error 2
Makefile:138: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/root/download/a20-kernel/u-boot-sunxi'
Makefile:43: recipe for target 'u-boot' failed
make: *** [u-boot] Error 2

Any ideas why is this happening? What do I need to install/read/do to get this working. I have read some info about cross compiling and I have added emdebian.org to the list of sources as I have read https://wiki.debian.org/CrossToolchains. Any help will be appriciated. Thank you

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: (Cross)Compiling a kernel for Pcduino3?

#2 Post by orythem27 »

I suggest setting up a dedicated system for this. For example, a Jessie chroot with the cross toolchain from emdebian.org. And after loading and modifying sun7i_defconfig, you would be using something like the following to compile:

Code: Select all

make -j`nproc` ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules
mkdir output
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install

nidzo
Posts: 3
Joined: 2017-08-14 04:39

Re: (Cross)Compiling a kernel for Pcduino3?

#3 Post by nidzo »

Thank you for your reply.
I did try that already but didn't compile with those options that you suggested. However when I try them this is what I get.

Code: Select all

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output
apply patch...
make[1]: Entering directory '/root/download/a20-kernel/u-boot-sunxi'
Configuring for pcDuino3 - Board: sun7i, Options: PCDUINO3,SPL
make[1]: Leaving directory '/root/download/a20-kernel/u-boot-sunxi'
make[1]: Entering directory '/root/download/a20-kernel/u-boot-sunxi'
  GEN     include/autoconf.mk.dep
  GEN     include/autoconf.mk
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
  CHK     include/config/uboot.release
  GEN     /root/download/a20-kernel/build/pcduino3-u-boot/Makefile
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  scripts/basic/fixdep
  UPD     include/config/uboot.release
  Using /root/download/a20-kernel/u-boot-sunxi as source for u-boot
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CC      arch/arm/lib/asm-offsets.s
  CC      lib/asm-offsets.s
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/lib/asm-offsets.c:15:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
/root/download/a20-kernel/u-boot-sunxi/./Kbuild:83: recipe for target 'arch/arm/lib/asm-offsets.s' failed
make[3]: *** [arch/arm/lib/asm-offsets.s] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /root/download/a20-kernel/u-boot-sunxi/include/linux/compiler.h:40:0,
                 from /root/download/a20-kernel/u-boot-sunxi/include/linux/byteorder/little_endian.h:12,
                 from /root/download/a20-kernel/u-boot-sunxi/arch/arm/include/asm/byteorder.h:29,
                 from /root/download/a20-kernel/u-boot-sunxi/include/compiler.h:112,
                 from /root/download/a20-kernel/u-boot-sunxi/include/image.h:19,
                 from /root/download/a20-kernel/u-boot-sunxi/include/common.h:94,
                 from /root/download/a20-kernel/u-boot-sunxi/lib/asm-offsets.c:15:
/root/download/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)
                              ^
compilation terminated.
/root/download/a20-kernel/u-boot-sunxi/./Kbuild:34: recipe for target 'lib/asm-offsets.s' failed
make[3]: *** [lib/asm-offsets.s] Error 1
/root/download/a20-kernel/u-boot-sunxi/Makefile:1018: recipe for target 'prepare0' failed
make[2]: *** [prepare0] Error 2
Makefile:138: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/root/download/a20-kernel/u-boot-sunxi'
Makefile:43: recipe for target 'u-boot' failed
make: *** [u-boot] Error 2

Observe the part with "fatal error: linux/compiler-gcc6.h: No such file or directory #include gcc_header(__GNUC__)" please. It looks to me that something is missing in gcc 6 headers. A search on google gives more links about this amongs them is this one https://github.com/linux-sunxi/sunxi-bsp/issues/16
There are no compiler support files for either gcc 5 or 6, which according to apt-cache search gcc | grep gnueabi means it can no longer be compiled with built in packages in current versions of Debian, which only include cross compilers for gcc versions 5 and 6.
. Looks like I have hit a dead end :(

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: (Cross)Compiling a kernel for Pcduino3?

#4 Post by orythem27 »

That is why I suggested a separate Jessie installation for this task.

nidzo
Posts: 3
Joined: 2017-08-14 04:39

Re: (Cross)Compiling a kernel for Pcduino3?

#5 Post by nidzo »

Oh ok. You were reffering that I should install debian 8.x...as I was trying with 9.0.1 .Ok I will try that. Thank you

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: (Cross)Compiling a kernel for Pcduino3?

#6 Post by orythem27 »

nidzo wrote:Oh ok. You were reffering that I should install debian 8.x...as I was trying with 9.0.1 .Ok I will try that. Thank you
No problem, I might have abused the usage of Debian release codenames...

Regarding cross toolchains, once I was building some programs for the Amazon Kindle and was recommended to use Ubuntu 12.04 or older.

Post Reply