Open
Description
Version: 19.1.7
Host OS: macOS Sonoma 14.4
Flags: -ffreestanding -mcmodel=kernel
Target: x86_64-none-elf
Code:
/* syscall entry point */
static auto syscall_entry = []() __attribute__((naked))
{
asm volatile(
"swapgs\n"
"movq %rsp, %gs:16\n"
"movq %gs:8, %rsp\n"
"ret"
);
};
I happened to run into a crash when compiling kernel code using a lambda with __attribute__((naked))
.
This code doesn't crash during compilation with x86_64-elf-g++
. I may be able to contribute a fix for this issue if needed.
Link to the attached file as I am not able to attach it normally: https://pastebin.com/GzeB8ga7