emerge with USE=kvm and CONFIG_DEBUG disabled causes build error on chromeos-4.4/4.12 |
|||||||||
Issue descriptionTo reproduce: "USE=kvm emerge-amd64-generic chromeos-kernel-4_4" after disabling CONFIG_DEBUG_INFO. Resulting build error: CC [M] arch/x86/kvm/emulate.o arch/x86/kvm/emulate.o: warning: objtool: .GCC.command.line+0x0: special: can't find new instruction ... MODPOST 306 modules FATAL: The relocation at __ex_table+0x70 references section ".GCC.command.line" which is not executable, IOW it is not possible for the kernel to fault at that address. Something is seriously wrong and should be fixed. The problem was also reproduced with chromeos-4.12.
,
Sep 26 2017
can you please clarify priority? is this a P3? and is this build using LLVM? (I don't think so, but then what is new that is causing/exposing the problem?)
,
Sep 26 2017
Priority is low. For my part it is primarily to record the problem; I am fine with marking it as WontFix. This is with gcc, not llvm/clang. There is nothing new; it is just a different combination of kernel build options that was never tested. Background is that I am adding the ability to run test builds. I encountered the problem while running "allmodconfig" or "allyesconfig" builds using the toolchain (test builds do not set CONFIG_DEBUG). I can work around the problem by explicitly adding " -g" to KCFLAGS (I have to set KCFLAGS anyway to work around https://bugzilla.kernel.org/show_bug.cgi?id=187841).
,
Sep 26 2017
ok, since we are moving the kernel to LLVM, I would suggest we don't work on this unless we can reproduce with LLVM.
,
Sep 27 2017
SGTM. I'll retest with clang after I have the initial setup working.
,
Sep 29 2017
Regarding clang: Turns out that building an "allmodconfig" or "allyesconfig" kernel with clang fails spectacularly, even with the latest upstream kernel. This is not an option for test builds, and will not be for the forseeable future.
,
Sep 29 2017
Turns out this is a problem with all toolchains I tested, not just with ours. Will discuss with upstream.
,
Oct 4 2017
See CL:699799 Turns out this is a gcc bug; gcc puts symbol 'kvm_fastop_exception' into the wrong section if the kernel is built with "-frecord-gcc-switches" and without "-g". This appears to affect all gcc versions. The CL adds a workaround into the kernel.
,
Oct 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/e6f479d8dca31429456b65356e84993f0f66f5b0 commit e6f479d8dca31429456b65356e84993f0f66f5b0 Author: Josh Poimboeuf <jpoimboe@redhat.com> Date: Thu Oct 05 07:34:17 2017 FROMLIST: x86/kvm: Move kvm_fastop_exception to .fixup section When compiling the kernel with the '-frecord-gcc-switches' flag, objtool complains: arch/x86/kvm/emulate.o: warning: objtool: .GCC.command.line+0x0: special: can't find new instruction And also the kernel fails to link. The problem is that the 'kvm_fastop_exception' code gets placed into the throwaway '.GCC.command.line' section instead of '.text'. Exception fixup code is conventionally placed in the '.fixup' section, so put it there where it belongs. BUG= chromium:769037 TEST="Build kvm with -frecord-gcc-switches and without -g" Change-Id: Ie88a4f0e637a1be403c3d74779004012d44d78d3 Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Guenter Roeck <groeck@chromium.org> (am from https://patchwork.kernel.org/patch/9984845/) Reviewed-on: https://chromium-review.googlesource.com/699799 Reviewed-by: Dylan Reid <dgreid@chromium.org> [modify] https://crrev.com/e6f479d8dca31429456b65356e84993f0f66f5b0/arch/x86/kvm/emulate.c
,
Oct 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/6144aedde4bffe3acf14bcfea0d2058e2caf8439 commit 6144aedde4bffe3acf14bcfea0d2058e2caf8439 Author: Josh Poimboeuf <jpoimboe@redhat.com> Date: Thu Oct 05 10:04:18 2017 FROMLIST: x86/kvm: Move kvm_fastop_exception to .fixup section When compiling the kernel with the '-frecord-gcc-switches' flag, objtool complains: arch/x86/kvm/emulate.o: warning: objtool: .GCC.command.line+0x0: special: can't find new instruction And also the kernel fails to link. The problem is that the 'kvm_fastop_exception' code gets placed into the throwaway '.GCC.command.line' section instead of '.text'. Exception fixup code is conventionally placed in the '.fixup' section, so put it there where it belongs. BUG= chromium:769037 TEST="Build kvm with -frecord-gcc-switches and without -g" Change-Id: Ie88a4f0e637a1be403c3d74779004012d44d78d3 Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Guenter Roeck <groeck@chromium.org> (am from https://patchwork.kernel.org/patch/9984845/) Reviewed-on: https://chromium-review.googlesource.com/699641 [modify] https://crrev.com/6144aedde4bffe3acf14bcfea0d2058e2caf8439/arch/x86/kvm/emulate.c
,
Oct 5 2017
While this is a gcc problem, it affects all versions of gcc, and thus had to be fixed in the kernel. Patch will hopefully be applied to the upstream kernel.
,
Jan 22 2018
,
Jan 23 2018
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by groeck@chromium.org
, Sep 26 2017