[M3devel] adapting C backend into system
Jay K
jay.krell at cornell.edu
Fri Sep 14 10:57:55 CEST 2012
I'm moving ahead..will change PPC_DARWIN on my system to generate C.My system is 64bit capable MacBook.It can run PowerPC (I'm not upgrading the OS to one that omits Rosetta!)PowerPC emulation isn't adequate for our preemptive suspend, but ok.
I suspect PPC_DARWIN is little used enough, that when I'm satisfied that it works,I can commit it and nobody will complain.
So then..
M3BackendMode_t = { (* The primary modes are currently 0 and 3. *) IntegratedObject, (* "0" -- don't call m3_backend, M3CG produces object code *) IntegratedAssembly, (* "1" -- don't call m3_backend, M3CG produces assembly code *) ExternalObject, (* "2" -- call m3_backend, it produces object code *) ExternalAssembly (* "3" -- call m3_backend, it produces assembly code *) };
ExternalObject can be made to work w/o changing cm3.I would build a separate driver like-m3cgcat.I would change the config/quake m3_backend to call it.Heck, ExternalAssembly could be made to work. (on Posix. maybe on NT, but pointless)
But that's not really the right way.I should add a new mode called IntegratedC.Agreed?Or just C.ExternalC would be kind of dumb..it'd be to use like-m3cgcat from m3_backend, and then in cm3 we'd call compile_c(). You might as well have m3_backend call compile_c andcall it IntegratedObject.
Agreed? New mode called "C"?
Think ahead.I want to generate C++, for portable/efficient exception handling.But not yet.
Would that be yet another mode?
If I don't change cm3 and add a mode, I'm "stuck" writing out the .mc files, reading them back, running a little driver. There is some developer convenience there, but it is needlessly inefficient when things are working.
I guess I might have a chance with IntegratedObject.M3C.m3 would call out to quake.
Think ahead..I need a cross/boot story.That writes out the .c files and stops.Ok..shouldn't be difficult..Seems kind of better therefore to add a mode, so the cm3 knows about this but M3C does not.Having the backend call out to quake is a bit odd. But the way we configure and detect the C compiler is too much quake code to abandon. I don't want to bake that into M3C.m3.
Thoughts?
Thanks, - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120914/6e5f45ef/attachment-0001.html>
More information about the M3devel
mailing list