omarrx024 wrote:
simeonz wrote:
If you are using 64 bit host to build, you need to pass -m32 to compiler, -m elf_i386 to the linker, -f elf32 to the assembler. After those fixes it works on my end.
Actually, you (and the OP) should use a
cross-compiler.
You mean in order to get proper libgcc, or there are differences in the code generator? The object files that provide arithmetic functions in libgcc do not call into the platform. And the code generator I imagine should be agnostic. Or you mean as a principle, because any other use is unsupported officially?
Also, if a person decides to use C++ in the kernel, there is little chance to get correct platform agnostic i386 support for exceptions, because they need thread local storage to operate (i.e. to track the current exception during unwinding.) Which means you will have to get dirty with rewriting at least a small amount of internal functions.
P.S. I have a cross-compiler lying around.