I also opted for making my own libc rather than using a prebuilt one. For now I've just provided enough of the standard headers so that libgcc builds successfully (as per the guide)
When using i686-substrata-gcc to try to build a simple user space program (literally just int main() { return 0; } ), I receive the following errors:
Code: Select all
/home/martin/opt/substrata/lib/gcc/i686-substrata/6.1.0/../../../../i686-substrata/bin/ld: cannot find crt0.o: No such file or directory
/home/martin/opt/substrata/lib/gcc/i686-substrata/6.1.0/../../../../i686-substrata/bin/ld: cannot find crti.o: No such file or directory
/home/martin/opt/substrata/lib/gcc/i686-substrata/6.1.0/../../../../i686-substrata/bin/ld: cannot find crtn.o: No such file or directory
- 1. Am I correct in assuming that I can't just use that crt0.s example, because my cross toolchain is 32-bit (i686-substrata-*) and not 64-bit (x86_64-substrata-*)?
2. How would I go about making an x86 version of crt0.s? More than just changing register names and the calling convention?
3. What is involved in creating an x86_64 version of the cross toolchain?
I apologise if my questions make no sense or have blindingly obvious answers. Any guidance is much appreciated.