Open mashaole opened 4 years ago
add "-fno-stack-protector" in GCCPARAMS. then you can fix this error(my english isn't good enough)
I am also having this issue. @devjuha adding "-fno-stack-protector" in GCCPARAMS does not fix this for me.
Edit:
I have tried this on Linux Mint 19.1
and Manjaro Linux
@devjuha im using Linux Mint 19.2 Cinnamon 32 bit
add "-fno-stack-protector" in GCCPARAMS. then you can fix this error(my english isn't good enough)
im using 32bit Linux mint 19.2 Cinnamon
i want to see that code. could you upload for me?
i want to see that code. could you upload for me?
i want to see that code. could you upload for me?
what is your compiler version? i'm using gcc 9.2.1 but compile was not complete. as version is 2.33.1. error message: g++ -c -o gdt.o gdt.cpp
gdt.cpp: In constructor ‘GlobalDescriptorTable::GlobalDescriptorTable()’: gdt.cpp:14:22: error: cast from ‘GlobalDescriptorTable*’ to ‘uint32_t’ {aka ‘unsigned int’} loses precision [-fpermissive] 14 | i[0] = (uint32_t)this; | ^~~~
i want to see that code. could you upload for me?
i think you should define __stack_chk_fail_local in gdt.cpp
Ok, so adding -fno-stack-protector
in the makefile's GCCPARAMS AND adding
uint32_t __stack_chk_fail_local(){
return 0;
}
in gdt.cpp has fixed my problem. Interestingly, I can now take away the __stack_chk_fail_local() function I declared in gdt.cpp and the compiler no longer raises any errors. So the issue is fixed for me but I don't understand this behavior.
Edit:
My fix works for me on both Linux Mint 19.2
and Manjaro Linux
.
A link to my repo https://github.com/sloganking/My-Own-OS
Edit:
add the above function to whatever file your compiler says has an error without it, not just gdt.cpp. The compiler tells me a different file needs it when I add new files or build this repo instead.
Ok, so adding "-fno-stack-protector" in the makefile's GCCPARAMS AND adding
uint32_t __stack_chk_fail_local(){ return 0; }
in gdt.cpp has fixed my problem. Interestingly, I can now take away the __stack_chk_fail_local() function I declared in gdt.cpp and the compiler no longer raises any errors. So the issue is fixed for me but I don't understand this behavior.
Edit:
My fix works for me on both
Linux Mint 19.2
andManjaro Linux
.A link to my repo https://github.com/SleepingFox88/My-Own-OS
i think very thankful because your problem was fixed!
@devjuha Yes, thank you very much.
Ok, so adding
-fno-stack-protector
in the makefile's GCCPARAMS AND addinguint32_t __stack_chk_fail_local(){ return 0; }
in gdt.cpp has fixed my problem. Interestingly, I can now take away the __stack_chk_fail_local() function I declared in gdt.cpp and the compiler no longer raises any errors. So the issue is fixed for me but I don't understand this behavior.
Edit:
My fix works for me on both
Linux Mint 19.2
andManjaro Linux
.A link to my repo https://github.com/sloganking/My-Own-OS
Edit:
add the above function to whatever file your compiler says has an error without it, not just gdt.cpp. The compiler tells me a different file needs it when I add new files or build this repo instead.
Ayyy, this works.
After writing the gdt.cpp file and calling the class in kernel.cpp and "make run" i get this error, is there a solution to this ?but the gdt.o is created but i cant compile the .bin file