Nerdenator
Posts: 1
Joined: Sat Oct 10, 2015 10:52 pm

Error while compiling kernel using guide provided

Sat Oct 10, 2015 11:17 pm

I'm using the guide provided at https://www.raspberrypi.org/documentati ... uilding.md, trying to compile a kernel on a cluster made of Raspberry Pi 2 boards.

I seem to have persistent issues with the kernel code not being compiled correctly. I've done some searching around on Google and on here but haven't found anything specifically dealing with what I'm experiencing. Here's what I'm seeing (sorry about the length):

Code: Select all

[email protected] ~ $ git clone --depth=1 https://github.com/raspberrypi/linux
Cloning into 'linux'...
remote: Counting objects: 52876, done.
remote: Compressing objects: 100% (50355/50355), done.
remote: Total 52876 (delta 4013), reused 17588 (delta 1852), pack-reused 0
Receiving objects: 100% (52876/52876), 142.61 MiB | 3.87 MiB/s, done.
Resolving deltas: 100% (4013/4013), done.
Checking connectivity... done.
Checking out files: 100% (49946/49946), done.
[email protected] ~ $ cd linux
[email protected] ~/linux $ KERNEL=kernel
[email protected] ~/linux $ make bcmrpi_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
[email protected] ~/linux $ time make -j5 zImage modules dtbs
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
....................
  CC      mm/frontswap.o
In file included from include/linux/sched.h:27:0,
                 from kernel/rcu/tree.c:37:
include/linux/mm_types.h:209:8: internal compiler error: Segmentation fault
 struct page_frag {
        ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
  CC [M]  fs/9p/v9fs.o
  CC [M]  crypto/ctr.o
  CC [M]  fs/9p/fid.o
  CC      mm/dmapool.o
  CC [M]  crypto/gcm.o
  CC [M]  fs/9p/xattr.o
  CC [M]  fs/9p/xattr_user.o
  CC      mm/slub.o
  CC [M]  fs/9p/xattr_trusted.o
  CC [M]  fs/9p/acl.o
  CC [M]  crypto/ccm.o
  LD [M]  fs/9p/9p.o
  CC      fs/autofs4/init.o
The bug is not reproducible, so it is likely a hardware or OS problem.
scripts/Makefile.build:258: recipe for target 'kernel/rcu/tree.o' failed
make[2]: *** [kernel/rcu/tree.o] Error 1
scripts/Makefile.build:403: recipe for target 'kernel/rcu' failed
make[1]: *** [kernel/rcu] Error 2
Makefile:947: recipe for target 'kernel' failed
make: *** [kernel] Error 2
make: *** Waiting for unfinished jobs....
  LD      fs/btrfs/built-in.o
  CC [M]  fs/btrfs/super.o
  CC      fs/autofs4/inode.o
....................
  CC      fs/fscache/netfs.o
  CC      fs/f2fs/segment.o
  CC [M]  fs/fuse/dir.o
In file included from include/linux/mm.h:921:0,
                 from include/linux/pagemap.h:7,
                 from include/linux/fscache.h:23,
                 from include/linux/fscache-cache.h:21,
                 from fs/fscache/internal.h:31,
                 from fs/fscache/netfs.c:15:
include/linux/vmstat.h: In function ‘count_vm_event’:
include/linux/vmstat.h:41:2: internal compiler error: Segmentation fault
  this_cpu_inc(vm_event_states.event[item]);
  ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
  CC [M]  fs/btrfs/raid56.o
The bug is not reproducible, so it is likely a hardware or OS problem.
scripts/Makefile.build:258: recipe for target 'fs/fscache/netfs.o' failed
make[2]: *** [fs/fscache/netfs.o] Error 1
scripts/Makefile.build:403: recipe for target 'fs/fscache' failed
make[1]: *** [fs/fscache] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC [M]  fs/btrfs/uuid-tree.o
  CC [M]  fs/fuse/file.o
  CC [M]  fs/fuse/inode.o
  CC      fs/ext4/extents.o
  CC [M]  fs/btrfs/props.o
  CC      fs/f2fs/recovery.o
  CC [M]  fs/fuse/control.o
cc1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
  CC      fs/f2fs/debug.o
  CC [M]  fs/btrfs/hash.o
  CC [M]  fs/btrfs/acl.o
  CC [M]  fs/fuse/cuse.o
The bug is not reproducible, so it is likely a hardware or OS problem.
scripts/Makefile.build:258: recipe for target 'fs/f2fs/recovery.o' failed
make[2]: *** [fs/f2fs/recovery.o] Error 1
make[2]: *** Waiting for unfinished jobs....
  LD [M]  fs/fuse/fuse.o
  CC      fs/ext4/ext4_jbd2.o
scripts/Makefile.build:403: recipe for target 'fs/f2fs' failed
make[1]: *** [fs/f2fs] Error 2
  CC      fs/ext4/migrate.o
....................
  LD      fs/ext4/built-in.o
Makefile:947: recipe for target 'fs' failed
make: *** [fs] Error 2

real	11m41.081s
user	43m2.340s
sys	2m1.510s
[email protected] ~/linux $ ccache -s
cache directory                     /home/pi/.ccache
cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                             0
files in cache                         0
cache size                             0 Kbytes
max cache size                       1.0 Gbytes
I keep running into the error when it comes to compiling code related to what I assume are file system components. When compiling these same kernel builds on my laptop using an x86-64 processor and the cross-compile toolchain, the kernel usually compiles without error. I'm not seeing anything accumulating in ccache. I also made sure to install the bc package as recommended in the guide. What can I do to resolve the error in the code I'm trying to compile now, or alternately, how can I get a hold of a version of the kernel from the Raspberry Pi repos that is compilable?

Return to “Linux Kernel”