Repository navigation
Description
Hello,I tryed to build last 4.5.2 kernel with your 4.5/master branch and get this error first:
LD mm/built-in.o
LD arch/x86/kvm/built-in.o
CC arch/x86/mm/init.o
CC kernel/rcu/tree.o
CC arch/x86/kernel/smp.o
CC arch/x86/mm/init_32.o
CC arch/x86/kernel/smpboot.o
CC arch/x86/mm/fault.o
LD kernel/rcu/built-in.o
CC kernel/sched/bfs.o
CC arch/x86/kernel/tsc_sync.o
CC arch/x86/kernel/setup_percpu.o
CC arch/x86/mm/ioremap.o
In file included from include/linux/static_key.h:1:0,
from include/linux/tracepoint-defs.h:11,
from ./arch/x86/include/asm/msr.h:75,
from ./arch/x86/include/asm/processor.h:20,
from ./arch/x86/include/asm/thread_info.h:52,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/kasan.h:4,
from kernel/sched/bfs.c:31:
kernel/sched/bfs.c: In function ‘ttwu_stat’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
^
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
^~~~~~~~~~~~~~~~~
kernel/sched/bfs.c:1450:3: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, ttwu_local);
^~~~~~~~~~~~~
kernel/sched/stats.h:32:55: note: each undeclared identifier is reported only once for each function it appears in
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
^
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
^~~~~~~~~~~~~~~~~
kernel/sched/bfs.c:1450:3: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, ttwu_local);
^~~~~~~~~~~~~
kernel/sched/bfs.c: In function ‘try_to_wake_up_local’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
^
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
^~~~~~~~~~~~~~~~~
kernel/sched/bfs.c:1625:4: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, ttwu_count);
^~~~~~~~~~~~~
scripts/Makefile.build:258: recipe for target 'arch/x86/kernel/setup_percpu.o' failed
^Cmake[3]: *_* [arch/x86/kernel/setup_percpu.o] Interrupt
scripts/Makefile.build:407: recipe for target 'arch/x86/kernel' failed
make[2]: *** [arch/x86/kernel] Interrupt
^Cscripts/Makefile.build:407: recipe for target 'kernel/sched' failed
Then I tried to bring the file to a section mean:
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
define schedstat_add(rq, field, amt) do { if (schedstat_enabled()) { (rq)->field += (amt); } } while (0)
define schedstat_set(var, val) do { if (schedstat_enabled()) { var = (val); } } while (0)
else /* !CONFIG_SCHEDSTATS */
to:
define schedstat_inc(rq, field) do { (rq)->field++; } while (0)
define schedstat_add(rq, field, amt) do { (rq)->field += (amt); } while (0)
define schedstat_set(var, val) do { var = (val); } while (0)
else /* !CONFIG_SCHEDSTATS */
as presented in the branch linux-4.5.y of linux-stable git repo and the main assembly of the image of the nucleus continues to step:
LD drivers/built-in.o
LINK vmlinux
LD vmlinux.o
MODPOST vmlinux.o
WARNING: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
kernel/built-in.o: In function profile_setup': /media/BUILD/zen++/kernel/profile.c:62: undefined reference toforce_schedstat_enabled'
kernel/built-in.o: In function sysctl_latencytop': /media/BUILD/zen++/kernel/latencytop.c:300: undefined reference toforce_schedstat_enabled'
Makefile:938: recipe for target «vmlinux»
make[1]: *** [vmlinux] Error 1
make[1]: exit from «/media/BUILD/zen++»
debian/ruleset/targets/common.mk:295: recipe for target «debian/stamp/build/kernel»
make: *** [debian/stamp/build/kernel] Error 2
Then I corrected these files, changing sections:
kernel/profile.c:62
if (!strncmp(str, sleepstr, strlen(sleepstr))) {
ifdef CONFIG_SCHEDSTATS
force_schedstat_enabled();
prof_on = SLEEP_PROFILING;
+++
if (!strncmp(str, sleepstr, strlen(sleepstr))) {
ifdef CONFIG_SCHEDSTATS
prof_on = SLEEP_PROFILING;
kernel/latencytop.c:300
static int __init init_lstats_procfs(void)
{
proc_create("latency_stats", 0644, NULL, &lstats_fops);
return 0;
}
int sysctl_latencytop(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int err;
err = proc_dointvec(table, write, buffer, lenp, ppos);
if (latencytop_enabled)
force_schedstat_enabled();
return err;
}
device_initcall(init_lstats_procfs);
+++
static int __init init_lstats_procfs(void)
{
proc_create("latency_stats", 0644, NULL, &lstats_fops);
return 0;
}
device_initcall(init_lstats_procfs);
And then I was able to continue the compilation.
I think in your tree branches nucleus traces of the old versions of these files, but you can directly fix these flaws in its repository.
With best wishes and thank you so much for your work!
Activity
sergiall commentedon Apr 29, 2016
I just found another fail issue:
MODPOST vmlinux.o
WARNING: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
kernel/built-in.o:(.data+0x1d6c): undefined reference to `sysctl_latencytop'
This is from kernel/sysctl.c:527:
#ifdef CONFIG_LATENCYTOP
{
.procname = "latencytop",
.data = &latencytop_enabled,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = sysctl_latencytop,
Solution is change ".proc_handler" reference to "proc_dointvec,":
#ifdef CONFIG_LATENCYTOP
{
.procname = "latencytop",
.data = &latencytop_enabled,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
FadeMind commentedon Apr 29, 2016
@sergiall use https://stackedit.io/editor for editing MarkDown text and use proper CODE formating for clear code reading.
I made this and code is here:
sergiall commentedon Apr 29, 2016
OK,Great Thanks for your attetion @FadeMind
damentz commentedon Apr 29, 2016
Can you guys try building again? I reverted back to our last merge to 4.5.2 and then added our latest changes in 4.5/misc. I'm not at a PC that's capable of building this kernel, however, so I can't verify that this corrects the issue.
sergiall commentedon Apr 30, 2016
@damentz, I just switch to 4.5/misc branch and I see what kernel version at this branch is old 4.5.0, but
kernel version of 4.5/master is 4.5.2 , but there were changes and therefore the merger of branches in the files between these kernels are present outdated "undefined reference" , which leads to errors when building the kernel at 4.5/master branch.If this possible,upgrade the kernel version of 4.5/misc branch and then merge it to main 4.5/master branch.
With best regards and thank you for you work!
sergiall commentedon Apr 30, 2016
or simply correct files in the resulting branch to remove the kernel build error...I now gather at the core of this branch at compile object module files (*.o) and will report new bugs, if such will be found.
FadeMind commentedon Apr 30, 2016
Todays build based on lastest sources failed.
@damentz these same error what I reported yesterday with
lustresubdir.I Just enabled:
Without enabled BFS flags kernel build just fine. NOTE:
CONFIG_SCHED_BFS_AUTOISOdisabled nothing change - the same fail.sergiall commentedon Apr 30, 2016
Yes,I found this error too:
LD [M] drivers/staging/vt6656/vt6656_stage.o LD [M] drivers/staging/xgifb/xgifb.o Building modules, stage 2. MODPOST 4140 modules ERROR: "screen_pos" [drivers/staging/speakup/speakup.ko] undefined! WARNING: modpost: Found 1 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y' scripts/Makefile.modpost:91: recipe for target '__modpost' failed make[2]: *** [__modpost] Error 1This is at drivers/staging/speakup/main.c file:
`
drivers/staging/speakup/main.c:269
...
static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
{
pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
return (u_char) (scr_readw(pos) >> 8);
}
changed to:static unsigned char get_attributes(u16 *pos)
{
return (u_char) (scr_readw(pos) >> 8);
}
at drivers/staging/speakup/main.c:476static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)
{
u16 ch = ' ';
}
changed to:static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)
{
u16 ch = ' ';
}
`
I just brought this section of code to the form, as shown in git.kernel.org's linux-stable kernel tree linux-4.5.y branch.
Good luck,guys
damentz commentedon Apr 30, 2016
Ok, this is strange. I just tested a build, made sure that BFS, speakup, and lustre modules were enabled, but I can't get the build to actually fail.
Can you guys upload your configuration somewhere so that I can compare? There must be something that is being enabled or disabled that is breaking the build.
Also a hint on getting to the source of the build failure. Take the source code and config and first run make -j4 (where 4 would be the number of cores you have), then after it fails, run make without any options so the error and the file the build failed at is the last message in your output.
And lastly, the only thing different on Liquorix is that BFS is disabled. I enabled BFS using the liquorix configuration and the build still succeeds. Configuration source: https://liquorix.net/sources/4.5/
FadeMind commentedon May 1, 2016
@damentz my config: config.x86_64.tar.gz
I using in default
MAKEFLAGS="-j$(nproc)"in
makepkg.confso give me 8 cores (i7-3610QM here).and lastest sent output fail build log results are based on it ~
make -j8.Now, I will follow just
makewithout${MAKEFLAGS}FadeMind commentedon May 1, 2016
@damentz here it is:
lastest lines:
FULL log:
FadeMind commentedon May 1, 2016
@damentz I just DISABLED these options in config
CONFIG_SCHED_DEBUGCONFIG_SCHEDSTATSand package BUILD SUCCESS 😆
Config and dmesg log:
config_dmesg_zen-BFS.tar.gz
sergiall commentedon May 2, 2016
Sorry for the delay, I have been busy, but if you're still interested, here is my config:
config.txt
and my real iron configuration:
uname -a
Linux DeXuR 4.5.2-zen-040502-generic++ #3 ZEN SMP PREEMPT Fri Apr 29 11:48:15 EEST 2016 i686 GNU/Linux
inxi -Fxz
System: Host: DeXuR Kernel: 4.5.2-zen-040502-generic++ i686 (32 bit gcc: 6.0.0)
Desktop: N/A Distro: Debian GNU/Linux 9.5 DeXuR
Machine: System: TOSHIBA (portable) product: Satellite PRO L20 v: PSL25E-00G018GR
Mobo: TOSHIBA model: Satellite PRO L20
Bios: TOSHIBA v: V1.70 date: 12/25/08
CPU: Single core Intel Pentium M (-UP-) cache: 2048 KB
flags: (nx pae sse sse2) bmips: 2129 speed/max: 1067/1733 MHz
Graphics: Card: Intel Mobile 915GM/GMS/910GML Express Graphics Controller
bus-ID: 00:02.0
Display Server: X.Org 1.18.3 drivers: intel (unloaded: fbdev,vesa)
Resolution: [email protected]
GLX Renderer: Mesa DRI Intel 915GM x86/MMX/SSE2
GLX Version: 2.1 Mesa 11.1.3 Direct Rendering: Yes
Audio: Card Intel 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller
driver: snd_intel8x0 ports: 1c00 18c0 bus-ID: 00:1e.2
Sound: ALSA v: k4.5.2-zen-040502-generic++
Network: Card-1: Realtek RTL-8100/8101L/8139 PCI Fast Ethernet Adapter
driver: 8139too v: 0.9.28 port: 3000 bus-ID: 06:02.0
IF: eth0 state: unknown speed: 100 Mbps duplex: full mac:
Card-2: Intel PRO/Wireless 2200BG [Calexico2] Network Connection
bus-ID: 06:04.0
IF: N/A state: N/A mac: N/A
Drives: HDD Total Size: 500.1GB (34.4% used)
ID-1: USB /dev/sda model: 00LPVX size: 500.1GB temp: 0C
Partition: ID-1: / size: 30G used: 13G (44%) fs: ext4 dev: /dev/sda9
ID-2: swap-1 size: 4.29GB used: 0.14GB (3%) fs: swap dev: /dev/sda5
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 70.0C mobo: N/A
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 151 Uptime: 3:53 Memory: 532.8/1496.2MB
Init: SysVinit runlevel: 2 Gcc sys: 6.1.1
Client: Shell (bash 4.3.421) inxi: 2.2.33
After all of the changes described above only, I was able to successfully assemble themselves working kernel based on config of the latest ubuntu generic kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline with additional patches.You can take it with previous versions here, but only for i386 arch:
http://downloads.sourceforge.net/project/cunztcamera/dex/pool/main/l/linux-source-4.5.2-zen-040502-generic++/*.deb
Thank you for your work and attention.
damentz commentedon May 3, 2016
Ok, I've merged the following change:
27c58ca
It looks like the stable queue is not so stable, usually this never happens and bugfixes only make fixes, not arbitrary optimizations. Yes, this optimization is nice but it breaks things. Oh well, for now we'll just turn it off if BFS is selected.
I verified locally, could someone else here test with their configuration?
FadeMind commentedon May 3, 2016
@damentz Build went fine.

After enabling
SCHED_BFS, configSCHEDSTATSis deleted.Thanks for fix.
damentz commentedon May 4, 2016
@FadeMind, @sergiall - thanks for providing information, I'll mark this as resolved.
habernir commentedon May 6, 2016
in master branch (kernel 4.5.3) it still write this error:
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (LATENCYTOP) selects SCHEDSTATS which has unmet direct dependencies (DEBUG_KERNEL && PROC_FS && !SCHED_BFS)
configuration written to .config
warning: (LATENCYTOP) selects SCHEDSTATS which has unmet direct dependencies (DEBUG_KERNEL && PROC_FS && !SCHED_BFS)
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC kernel/sched/bfs.o
In file included from include/linux/static_key.h:1:0,
from include/linux/tracepoint-defs.h:11,
from ./arch/x86/include/asm/msr.h:75,
from ./arch/x86/include/asm/processor.h:20,
from ./arch/x86/include/asm/thread_info.h:52,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/kasan.h:4,
from kernel/sched/bfs.c:31:
kernel/sched/bfs.c: In function ‘ttwu_stat’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
kernel/sched/bfs.c:1450:3: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, ttwu_local);
^
kernel/sched/stats.h:32:55: note: each undeclared identifier is reported only once for each function it appears in
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
kernel/sched/bfs.c:1450:3: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, ttwu_local);
^
kernel/sched/bfs.c: In function ‘try_to_wake_up_local’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
kernel/sched/bfs.c:1625:4: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, ttwu_count);
^
kernel/sched/bfs.c: In function ‘schedule_debug’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
kernel/sched/bfs.c:3309:2: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(this_rq(), sched_count);
^
kernel/sched/bfs.c: In function ‘__schedule’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
kernel/sched/bfs.c:3545:3: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(rq, sched_goidle);
^
kernel/sched/bfs.c: In function ‘sys_sched_yield’:
kernel/sched/stats.h:32:55: error: ‘sched_schedstats’ undeclared (first use in this function)
define schedstat_enabled() static_branch_unlikely(&sched_schedstats)
include/linux/jump_label.h:347:43: note: in definition of macro ‘static_branch_unlikely’
if (__builtin_types_compatible_p(typeof(_x), struct static_key_true))
^
kernel/sched/stats.h:33:44: note: in expansion of macro ‘schedstat_enabled’
define schedstat_inc(rq, field) do { if (schedstat_enabled()) { (rq)->field++; } } while (0)
kernel/sched/bfs.c:4758:2: note: in expansion of macro ‘schedstat_inc’
schedstat_inc(task_rq(p), yld_count);
^
scripts/Makefile.build:258: recipe for target 'kernel/sched/bfs.o' failed
make[2]: *** [kernel/sched/bfs.o] Error 1
scripts/Makefile.build:407: recipe for target 'kernel/sched' failed
make[1]: *** [kernel/sched] Error 2
Makefile:952: recipe for target 'kernel' failed
make: *** [kernel] Error 2
and when i enabling SCHED_BFS the SCHEDSTATS is not deleted.
or when i delete the SCHEDSTATS and try to compile its write me the same error (and the SCHEDSTATS write me enabled)
memcg: mem_cgroup_migrate() may be called with irq disabled
GenWQE: Fix bad page access during abort of resource allocation
mptcp: fix spurious retransmissions
um: Mark all kernel symbols as local
arm64: cmpxchg_double*: hazard against entire exchange variable
of_numa: fix uninitialized memory nodes causing kernel panic
of_numa: fix uninitialized memory nodes causing kernel panic