After installation of gentoo-sources-6.7.1 make oldconfig presented me with a question about setting SCHED_ALT (allow alternative schedulers), with Y as default. I agreed. After that, make failed. After making SCHED_ALT is not set, kernel build succeeded. Reproducible: Always Actual Results: CC kernel/sched/alt_core.o In file included from ./include/linux/string.h:295, from ./include/linux/bitmap.h:12, from ./include/linux/cpumask.h:12, from ./include/linux/smp.h:13, from ./include/linux/sched/clock.h:5, from kernel/sched/alt_core.c:14: In function ‘bitmap_copy’, inlined from ‘cpumask_copy’ at ./include/linux/cpumask.h:756:2, inlined from ‘sched_init’ at kernel/sched/alt_core.c:7701:3: ./include/linux/fortify-string.h:57:33: error: ‘__builtin_memcpy’ reading between 41 and 2520 bytes from a region of size 40 [-Werror=stringop-overread] 57 | #define __underlying_memcpy __builtin_memcpy | ^ ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ 644 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ ./include/linux/bitmap.h:245:17: note: in expansion of macro ‘memcpy’ 245 | memcpy(dst, src, len); | ^~~~~~ ./include/linux/cpumask.h: In function ‘sched_init’: ./include/linux/cpumask.h:127:23: note: source object ‘__cpu_present_mask’ of size 40 127 | extern struct cpumask __cpu_present_mask; | ^~~~~~~~~~~~~~~~~~ In function ‘bitmap_copy’, inlined from ‘cpumask_copy’ at ./include/linux/cpumask.h:756:2, inlined from ‘sched_init’ at kernel/sched/alt_core.c:7701:3: ./include/linux/fortify-string.h:57:33: error: ‘__builtin_memcpy’ reading between 41 and 2520 bytes from a region of size 40 [-Werror=stringop-overread] 57 | #define __underlying_memcpy __builtin_memcpy | ^ ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ 644 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ ./include/linux/bitmap.h:245:17: note: in expansion of macro ‘memcpy’ 245 | memcpy(dst, src, len); | ^~~~~~ ./include/linux/cpumask.h: In function ‘sched_init’: ./include/linux/cpumask.h:127:23: note: source object ‘__cpu_present_mask’ of size 40 127 | extern struct cpumask __cpu_present_mask; | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[4]: *** [scripts/Makefile.build:243: kernel/sched/alt_core.o] Error 1 make[3]: *** [scripts/Makefile.build:480: kernel/sched] Error 2 make[2]: *** [scripts/Makefile.build:480: kernel] Error 2 make[1]: *** [/usr/src/linux-6.7.1-gentoo/Makefile:1911: .] Error 2 make: *** [Makefile:234: __sub-make] Error 2
Created attachment 882760 [details] Config with build failure
Created attachment 882761 [details] Config of successful build
USE=experimental, of course.
sys-kernel/gentoo-sources-6.7.2::gentoo USE="experimental symlink -build" Issue persists. Error is the same.
Seems to be a result of upstream enabling -Wstringop-overflow globally. I was able to successfully compile it with GCC 14. This should be reported upstream. https://gitlab.com/alfredchen/linux-prjc/-/issues
Why can I build & run vanilla upstream 6.7.2 with BMQ enabled using gcc-13.2.1_p20240113-r1 without any issue? If -Wstringop-overflow were enabled globally by mainline I'd see the error as well.
(In reply to Holger Hoffstätte from comment #6) > Why can I build & run vanilla upstream 6.7.2 with BMQ enabled using > gcc-13.2.1_p20240113-r1 without any issue? If -Wstringop-overflow were > enabled globally by mainline I'd see the error as well. Ah - probably because gentoo-sources has additional Kconfig stuff and enables FORTIFY_SOURCE and other hardening options.
Reported upstream at https://gitlab.com/alfredchen/linux-prjc/-/issues/92
We'll follow the upstream bug and apply any fixes identified.