Skip to content

Undefined reference to __stack_chk_fail #1

@HectorPeeters

Description

@HectorPeeters

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions