-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C Compiler Problem #70
Comments
The toolchain support was never completed. The most robust piece is going to be the assembler. As you see, pcc is able to compile C code down to MIPS assembly, but the pcc backend almost certainly suffers from a number of hidden bugs that I just never got around to fixing when I created the MIPSel pcc backend. The linker is probably the weakest link: Serge heroically got the ELFtoolchain linker to support mips32, but I have no idea how reliable the ELFtoolchain linker is. Upstream ELFtoolchain ld is almost certainly dead since FreeBSD adopted the LLVM ld. |
There is a bug in linker: I tried to fix it, but something is still wrong with %hi/%lo relocation. |
Thanks for the replies. Was there any reason why the original BSD C compiler (cc) could not be ported in much the same way as other utility programs have been ported? It might have only been pre ANSI C, but it works. Forgive me for the lack of knowledge regarding the details of this project. |
The original BSD C compiler is pcc. |
Ah thanks for the explanation. I presumed the original BSD had already been ported to work on MIPS by UC or AT&T. Clearly there was much more work involved than I appreciated in converting to PIC32. |
For what it's worth, PCC had support for the MIPS http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/pcc/mips/ |
pcc has support for MIPS. You're looking at the wrong repository. pcc can be found here: http://pcc.ludd.ltu.se/ |
Has anyone been able to build using cc and then run an executable from within LiteBSD?
/* Hello world program, hello.c. */
#include <stdio.h>
main()
{
printf("hello world\n");
}
Compiling "hello.c" gives the following linker editor error.
$ cc hello.c
ld: multiple definition of symbol __divdi3
error: ld terminated with status 1
/* Null program, null.c. */
main()
{
}
Compiling "null.c" gives no compile/linker error, but causes a memory runtime error.
$ cc null.c
$ ./a.out
sh: ./a.out: Cannot allocate memory
Any ideas?
The text was updated successfully, but these errors were encountered: