Error when compiling kernel with RCN's bb-kernel script

A student of mine posted this and documented well. I’m getting the same error so I’m hoping someone here can help.


I seem to be having an error compiling the kernel on my Linux virtual machine.

The virtual machine has 4GB ram, 32GB hard disk space, and four processor cores. Here you can see the complete setup. The operating system is ubuntu 16.04 LTS, complete details here.

From the initial boot of the system, I ran the following 7 commands:

sudo apt install git
**git clone git****://[](**
**cd bb-kernel**
**git checkout am33x-v4.4**
sudo apt-get update
sudo apt-get install device-tree-compiler lzma lzop libncurses5-dev:amd64

The output can be seen here. Most of the compilation was uneventful, but there is a warning on line 2362 of the paste, and an error starting on line 2656. The error reads:


kernel/cpuset.c:2101:11: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .fork  = cpuset_fork,
kernel/cpuset.c:2101:11: note: (near initialization for 'cpuset_cgrp_subsys.fork')
  CC [M]  crypto/lz4.o
  CC [M]  crypto/lz4hc.o
  CC      block/bsg-lib.o
  CC [M]  crypto/ansi_cprng.o
cc1: some warnings being treated as errors
scripts/ recipe for target 'kernel/cpuset.o' failed
make[1]: *** [kernel/cpuset.o] Error 1
Makefile:947: recipe for target 'kernel' failed
make: *** [kernel] Error 2
make: *** Waiting for unfinished jobs....


Has anyone else had similar problems? Has anyone successfully compiled the kernel?



I also noticed it 4.4.22, looks to be a gcc6 issue,

I have the am33x-v4.4 branch set on gcc5:


This is the offending commit:


It's missing this change that landed in v4.5.x


and pushed, only built tested on am33x-v4.4/am33x-rt-v4.4


That fixed it. Thanks!

One question: How did you figure out where the problem was? This is a good lesson for my students.


Google: git bisect

— Graham

In the case of this bug, it helps that i build on every distro:

[TXT] COMPLETE-4.4.22-bone13-jessie-armhf.txt 2016-09-27 07:31 775K
[TXT] COMPLETE-4.4.22-bone13-sid-armhf.txt 2016-09-27 06:52 382K
[TXT] COMPLETE-4.4.22-bone13-stretch-armhf.txt 2016-09-27 03:54 379K
[TXT] COMPLETE-4.4.22-bone13-trusty-armhf.txt 2016-09-27 06:41 773K
[TXT] COMPLETE-4.4.22-bone13-wheezy-armhf.txt 2016-09-27 05:35 775K
[TXT] COMPLETE-4.4.22-bone13-xenial-armhf.txt 2016-09-27 07:01 429K
[TXT] COMPLETE-4.4.22-bone13-yakkety-armhf.txt 2016-09-27 07:27 392K

You'll notice ^, sid/stretch/xenial/yakkety are slightly smaller then

jessie: 4.9.2 (good)
sid: 6.2.0 (fail)
stretch: 6.1.1 (fail)
trusty: 4.8.4 (good)
wheezy: 4.6.3 (good)
xenial: 5.4.0 (fail, didn't notice this till now, so it's a gcc5+ bug..)
yakkety: 6.2.0 (fail)

Then we take a look at the file, kernel/cpuset.c:

  CC kernel/cpuset.o
  CC [M] sound/core/seq/seq_midi_event.o
  CC drivers/base/devres.o
kernel/cpuset.c:2101:11: error: initialization from incompatible
pointer type [-Werror=incompatible-pointer-types]
  .fork = cpuset_fork,
kernel/cpuset.c:2101:11: note: (near initialization for

as every had been working pre 4.4.22, we look at the change log on that file..

This was a backport on mainline, adding ".fork" option to the
cpuset_cgrp_subsys struct..

So let's take a look at the cgroup_subsys and see if anything had
changed between v4.4.21 and mainline..

void (*fork)(struct task_struct *task, void *priv);

void (*fork)(struct task_struct *task);

so the "void *priv" had been removed..

That led me to this change:

I added it to my tree and ran a full rebuild to make sure nothing else
depended on the now gone (void *priv) option..