https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102361
Bug ID: 102361 Summary: Errors compiling Linux kernel 5.14.4 with CONFIG_FORTIFY=y Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dac324 at yahoo dot de Target Milestone: --- GCC version: gcc (GCC) 12.0.0 20210910 (experimental) With this version, it is not possible to compile the Linux kernel sources (tested with both 5.14.1 and 5.14.4). Problem is that GCC 12 conflicts with CONFIG_FORTIFY=y. Errors thrown with the 5.14.1 kernel sources: In function 'memset', inlined from 'init_rock_state.part.0' at fs/isofs/rock.c:74:2: ./include/linux/fortify-string.h:172:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter 172 | __write_overflow(); | ^~~~~~~~~~~~~~~~~~ make[2]: *** [scripts/Makefile.build:271: fs/isofs/rock.o] Error 1 make[1]: *** [scripts/Makefile.build:514: fs/isofs] Error 2 In function 'memcpy', inlined from 'tl_to_darg.part.0' at fs/ext4/fast_commit.c:1295:2: ./include/linux/fortify-string.h:187:25: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter 187 | __read_overflow2(); | ^~~~~~~~~~~~~~~~~~ make[2]: *** [scripts/Makefile.build:271: fs/ext4/fast_commit.o] Error 1 make[1]: *** [scripts/Makefile.build:514: fs/ext4] Error 2 Error thrown with the 5.14.4 kernel sources: In Function »memcpy«, inserted from von »tl_to_darg.part.0« bei fs/ext4/fast_commit.c:1295:2: ./include/linux/fortify-string.h:187:25: Error: call to »__read_overflow2« declared with attribute error: detected read beyond size of object passed as 2nd parameter 187 | __read_overflow2(); | ^~~~~~~~~~~~~~~~~~ With GCC 11, these errors do not occur. Hence, I must assume that they are related to the compiler version.