Skip to content

Commit 00a241f

Browse files
groeckakpm00
authored andcommitted
x86: disable image size check for test builds
64-bit allyesconfig builds fail with x86_64-linux-ld: kernel image bigger than KERNEL_IMAGE_SIZE Bisect points to commit 6f110a5 ("Disable SLUB_TINY for build testing") as the responsible commit. Reverting that patch does indeed fix the problem. Further analysis shows that disabling SLUB_TINY enables KASAN, and that KASAN is responsible for the image size increase. Solve the build problem by disabling the image size check for test builds. [akpm@linux-foundation.org: add comment, fix nearby typo (sink->sync)] [akpm@linux-foundation.org: fix comment snafu Link: https://lore.kernel.org/oe-kbuild-all/202504191813.4r9H6Glt-lkp@intel.com/ Link: https://lkml.kernel.org/r/20250417010950.2203847-1-linux@roeck-us.net Fixes: 6f110a5 ("Disable SLUB_TINY for build testing") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Konovalov <andreyknvl@gmail.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Borislav Betkov <bp@alien8.de> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Thomas Gleinxer <tglx@linutronix.de> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: <x86@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent bd1261b commit 00a241f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/x86/kernel/vmlinux.lds.S

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,18 @@ SECTIONS
466466
}
467467

468468
/*
469-
* The ASSERT() sink to . is intentional, for binutils 2.14 compatibility:
469+
* COMPILE_TEST kernels can be large - CONFIG_KASAN, for example, can cause
470+
* this. Let's assume that nobody will be running a COMPILE_TEST kernel and
471+
* let's assert that fuller build coverage is more valuable than being able to
472+
* run a COMPILE_TEST kernel.
473+
*/
474+
#ifndef CONFIG_COMPILE_TEST
475+
/*
476+
* The ASSERT() sync to . is intentional, for binutils 2.14 compatibility:
470477
*/
471478
. = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
472479
"kernel image bigger than KERNEL_IMAGE_SIZE");
480+
#endif
473481

474482
/* needed for Clang - see arch/x86/entry/entry.S */
475483
PROVIDE(__ref_stack_chk_guard = __stack_chk_guard);

0 commit comments

Comments
 (0)