[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CABD8wQkJ7ZrjeBszFqd92x504hXmbEPdcUpBft3KSnZo-70a2Q@mail.gmail.com>
Date: Wed, 24 Jun 2020 12:50:19 +0530
From: Caleb Jorden <cjorden@...il.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org
Subject: GCC_PLUGIN_RANDSTRUCT being set breaks 5.8-rc2 build
Hi everyone,
I was trying to test out the 5.8-rc2 kernel using my standard
machine-specific config, but my build kept failing. I ended up
comparing against the x86_64_defconfig configuration (which worked)
using the config-bisect.pl script, and discovered that if
GCC_PLUGIN_RANDSTRUCT is set, I get this error:
--------------------
In file included from ./arch/x86/include/asm/atomic.h:5,
from ./include/linux/atomic.h:7,
from ./include/linux/llist.h:51,
from ./include/linux/irq_work.h:5,
from kernel/smp.c:10:
kernel/smp.c: In function ‘smp_init’:
./include/linux/compiler.h:392:38: error: call to
‘__compiletime_assert_157’ declared with attribute error: BUILD_BUG_ON
failed: offsetof(struct task_struct, wake_entry_type) -
offsetof(struct task_struct, wake_entry) != offsetof(struct
__call_single_data, flags) - offsetof(struct __call_single_data,
llist)
392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
./include/linux/compiler.h:373:4: note: in definition of macro
‘__compiletime_assert’
373 | prefix ## suffix(); \
| ^~~~~~
./include/linux/compiler.h:392:2: note: in expansion of macro
‘_compiletime_assert’
392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro
‘compiletime_assert’
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
kernel/smp.c:687:2: note: in expansion of macro ‘BUILD_BUG_ON’
687 | BUILD_BUG_ON(offsetof(struct task_struct, wake_entry_type) -
offsetof(struct task_struct, wake_entry) !=
| ^~~~~~~~~~~~
CC fs/fs_context.o
make[1]: *** [scripts/Makefile.build:281: kernel/smp.o] Error 1
--------------------
I am able to reproduce this error now if I use the x86_64_defconfig,
and simply set GCC_PLUGIN_RANDSTRUCT from the configuration tree in:
- General architecture-dependent options
- GCC plugins
[x] Randomize layout of sensitive kernel structures
It appears the cause is this commit:
---------------------
commit a148866489fbe243c936fe43e4525d8dbfa0318f
Author: Peter Zijlstra <peterz@...radead.org>
Date: Tue May 26 18:11:04 2020 +0200
sched: Replace rq::wake_list
---------------------
I am observing these build failures on GCC 9.3.0 (Gentoo) and GCC
10.1.0 (Manjaro) using the 5.8-rc2 kernel from git
(48778464bb7d346b47157d21ffde2af6b2d39110).
I am not on the kernel mailing list, if there is anything I can do to
assist with fixing this, please copy me directly.
Thanks!
Caleb Jorden
cjorden@...il.com
Powered by blists - more mailing lists