539kernel icon indicating copy to clipboard operation
539kernel copied to clipboard

Undefined reference to `__stack_chk_fail`

Open HectorPeeters opened this issue 3 years ago • 0 comments

When compiling the progenitor version of the kernel using gcc 12.2.0, the following error appears.

main.c:(.text+0x1d8): undefined reference to `__stack_chk_fail'

This could be fixed by either adding the -fno-stack-protector flag to KERNEL_FLAGS or by implementing the __stack_chk_fail function. A possible implementation could be:

void __stack_chk_fail() {
	print("Stack check failed!");
	while (1);
}

HectorPeeters avatar Nov 22 '22 18:11 HectorPeeters