9front - general discussion about 9front
 help / color / mirror / Atom feed
* alternative compilers
@ 2011-06-20 21:39 ron minnich
  2011-06-20 21:49 ` Julius Schmidt
                   ` (2 more replies)
  0 siblings, 3 replies; 43+ messages in thread
From: ron minnich @ 2011-06-20 21:39 UTC (permalink / raw)
  To: 9front

fyi, you can get nix, but you can't get a real 64-bit compiler for
AMD. Why am I saying this? Isn't amd64 64-bit?

Yes, but ... 6c/6l don't produce code that can use 64 bit pointers.
The pointers are always truncated to 32 bits, so you have to use
pointers that sign extend, i.e.
kernel mode pointers have to be ffffffff'80000000 or greater, and user
pointers have to be 7fffffff or less. Yes, I'm well aware that stack
is at 7fff ffffffff but that's actually a special case.

So, question, anyone interested in making other compilers work on
9front? If so, which ones?

you may find this hard to  believe. If you do, take this code:
#include <u.h>
#include <libc.h>
char data = 5;
b(void){
	 char *c = &data ;
	return *c * 5;
}
main()
{
	int i;
	print("&i %#p\n", &i);
	print("Good morning\n");
	print("%d\n", b());
}
/* 6c b.c; 6l -R0x20000000 b.6; nm -n 6.out */

and run this command:
6l -a -R0x20000000 b.6

and looked at the code for b(). Then come back and talk :-)

ron
p.s. Of course, another option is to modify 6l to do better. That
would be cool too. But at the same time, I'm not so sure how long this
should go on. Maybe we should use this one: http://bellard.org/tcc/

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2011-06-27  0:42 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-20 21:39 alternative compilers ron minnich
2011-06-20 21:49 ` Julius Schmidt
2011-06-20 21:49   ` ron minnich
2011-06-20 21:52     ` Julius Schmidt
2011-06-21 10:01   ` suharik
2011-06-21 10:31     ` Noah Evans
2011-06-21 11:13       ` Uriel
2011-06-21 11:16         ` Noah Evans
2011-06-21 11:23           ` suharik
2011-06-21 13:56           ` Julius Schmidt
2011-06-21 14:36             ` Noah Evans
2011-06-21 14:47               ` Julius Schmidt
2011-06-21 14:50                 ` Noah Evans
2011-06-21 22:21                   ` Iruatã Souza
2011-06-22  8:50                     ` Noah Evans
2011-06-22 10:04                       ` Julius Schmidt
2011-06-22 10:49                         ` Noah Evans
2011-06-22 11:06                           ` Julius Schmidt
2011-06-22 11:10                             ` Uriel
2011-06-22 11:19                               ` Julius Schmidt
2011-06-22 11:15                             ` Noah Evans
2011-06-22 11:29                               ` Uriel
2011-06-22 11:06                           ` Uriel
2011-06-22 12:10                           ` Iruatã Souza
2011-06-22 12:24                             ` Uriel
2011-06-22 12:41                               ` Julius Schmidt
2011-06-22 12:52                                 ` Uriel
2011-06-22 14:54                                   ` Stanley Lieber
2011-06-22 14:56                                     ` John Floren
2011-06-22 14:57                                       ` Stanley Lieber
2011-06-22 15:24                           ` Kurt H Maier
2011-06-22 16:47                             ` Stanley Lieber
2011-06-27  0:34                             ` cinap_lenrek
2011-06-27  0:42                               ` Kurt H Maier
2011-06-22 11:01                         ` Uriel
2011-06-21 14:53                 ` Uriel
2011-06-21 11:12     ` Uriel
2011-06-21 14:05     ` Jacob Todd
2011-06-21  4:08 ` Jens Staal
2011-06-21 13:48   ` Iruatã Souza
2011-06-21 13:58     ` Jens Staal
2011-06-21 14:16   ` Uriel
2011-06-21 11:14 ` Uriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).