Raspberry PiのWebサイトで提供されているガイドを使用してカーネルをコンパイル中にエラーが発生しました。

Raspberry PiのWebサイトで提供されているガイドを使用してカーネルをコンパイル中にエラーが発生しました。

ソースからカーネルをコンパイルしようとするとエラーが発生します。周りを見回しましたが、現在発生しているエラーを具体的に処理する項目が見つかりませんでした。

ガイドを使っています。ラズベリーパイからウェブサイトにアクセスしてプロセスを完了し、私は指示に従いました。私はこれをRaspbian Jessieを実行するRaspberry Pi 2ボードでRaspberry PiモデルB(第1世代)用のカーネルにコンパイルしています。これらのエラーは、カーネルが元のカーネル用であるかRaspberry Pi 2用であるかに関係なく発生します。私がやっていることと見ていることは次のとおりです。

pi@rpi4 ~ $ 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.
pi@rpi4 ~ $ cd linux
pi@rpi4 ~/linux $ KERNEL=kernel
pi@rpi4 ~/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
#
pi@rpi4 ~/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
pi@rpi4 ~/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

ご覧のとおり、ファイルシステムコンポーネントとモジュールのビルド中にコンパイルプロセスが失敗します。 Ccacheもファイルを選択しないようです。ハードウェアの問題により内部コンパイラエラーがあると表示されますが、それが何であるかはわかりません。

問題は、クロスコンパイルツールチェーンがインストールされているUbuntuを実行しているx86-64システムであるラップトップでカーネルとモジュールもコンパイルしていることです。ラップトップはカーネルのコンパイル成功率がはるかに高いようです。作業を完了するためにこれを使用しますが、私はRaspberry Pi自体でコンパイルするときにもっと意味のあるプロジェクトを進めています。私は解決策を探していましたが見つかりませんでした。

ベストアンサー1

残念ながら、これはシステム全体で発生する問題のようです。 OSを再インストールすると問題が解決し、NOOBSに切り替えるか、OSを直接イメージングしました。最もエレガントな解決策ではありませんが、そこにあります。

おすすめ記事