[comp.sys.next] Porting binaries

mccalpin@masig2.ocean.fsu.edu (John D. McCalpin) (07/29/89)

I have heard that it is possible to run sun3 binaries on the NeXT
(at least under 0.9).
Are there any tricks required for this?  I have had no success
so far.  I get messages like:
	model: line 6, unknown command "^D^Mp"
or some such, where "model" is an f77 code compiled on a sun3.
--
John D. McCalpin - mccalpin@masig1.ocean.fsu.edu - mccalpin@nu.cs.fsu.edu
		   mccalpin@delocn.udel.edu

jgreely@oz.cis.ohio-state.edu (J Greely) (07/29/89)

In article <MCCALPIN.89Jul28133612@masig2.ocean.fsu.edu> mccalpin@masig2.ocean.fsu.edu (John D. McCalpin) writes:
>I have heard that it is possible to run sun3 binaries on the NeXT
>(at least under 0.9).

Since this one keeps coming up, I'll trash it publicly.  The ability
to run Sun 3 binaries was a feature of Mach that was supported under
0.8.  It went bye-bye in 0.9.  Having been removed, the chances of it
reappearing are slim to none (leaning towards none, I'm sure).

  Personally, I was rather fond of it, since it drastically cut the
time needed to make a NeXT look like the other workstations here.
Since you can't just compile most software (usually, it's: compile,
hack Makefile, compile, hack source, compile, hack includes, compile,
hack Makefile...), you spend a *lot* of time localizing the machine.
If we had 200+ NeXTs and 2 Suns, it wouldn't be a big deal, but it's
the other way around...


				"And say a prayer, if you remember
				 any.  What the hell.  Even now, a
				 little flattery couldn't hurt."
-=-
J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)

jgreely@oz.cis.ohio-state.edu (J Greely) (07/30/89)

(first bald statement I make in weeks, and what happens?  Someone
corrects me.  Thanks to John McCalpin for pointing out something I
overlooked)

>In article <MCCALPIN.89Jul28133612@masig2.ocean.fsu.edu>
> mccalpin@masig2.ocean.fsu.edu (John D. McCalpin) writes:
>>I have heard that it is possible to run sun3 binaries on the NeXT
>>(at least under 0.9).

[my partially correct response deleted]

As John pointed out to me in e-mail, my previous answer isn't correct.
Sun3 binaries no longer run directly, but they can be converted to
Mach-O format using atom(1).

  Somehow, I've managed to overlook that one for the past three
months.  That's what I get for trusting the manuals :-).


		"Who's it *this* time?"
					"Concert promoters who have
					 gone broke organizing charity
					 benefit concerts.  We call it
					 Aid Aid."
-=-
J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)

march@m.cs.uiuc.edu (08/02/89)

That's really strange ... I just brought over some Sun 3 binaries, ran them
through atom(1) to convert from a.out format to Mach-O object format and
it worked just fine.  And yes, I've done this on two 0.9 NeXT systems.  

(This is how I explain the binary compatablity; but actually I think that 
atom(1) is most if not all of the trick to getting 680[23]0 binaries to
execute on a NeXT.)
NeXT uses the same 'machine type' hack that Sun uses ... maybe this is an
indication that NeXT plans to make another type of machine or remain at least
somewhat compatable with Sun object code ( :-) ??).  In the file
/usr/include/sys/exec.h off of my local NeXT system (of which the following
is an excerpt) ...

/*
 **********************************************************************
 * HISTORY
 * 13-Feb-88  John Seamons (jks) at NeXT
 *	NeXT: use same hack as Sun for machine type.
 *

	[misc history and copyright stuff taken out]

/*
 * Header prepended to each a.out file.
 */
struct exec {
#if	sun || NeXT
unsigned short  a_machtype;     /* machine type */
unsigned short  a_magic;        /* magic number */
	
	[more misc stuff removed including the machine type numbers for Suns]

On a normal 4.[23]BSD system using the a.out format from way back in 4.1BSD
(in other words "The standard") has a "long" exec.a_magic not a "short" as 
Sun and NeXT are using.

Hopefully this will shed some light on the subject.  Can anyone in netland
confirm this theory or have an opposing one?  Does anyone see any problems
or have the "inner track" on this subject?  If so let us know!

/* Written  9:29 am  Jul 29, 1989 by jgreely@oz.cis.ohio-state.edu in m.cs.uiuc.edu:comp.sys.next */
/* ---------- "Re: Porting binaries" ---------- */
Since you can't just compile most software (usually, it's: compile,
hack Makefile, compile, hack source, compile, hack includes, compile,
hack Makefile...), you spend a *lot* of time localizing the machine.

Boy does this sound familiar ... but then I tried using atom(1) ... IT WORKED!!
Well I felt pretty dumb for not trying it in the first place.  I agree with
the original poster (jgreely), having the binary compatibility is quite
handy.  Especially when one is trying to port large applications one has not
written him/herself.

				Steve


===============================================================================
Steve March						(H) 344-5303
Department of Computer Science, University of Illinois	(W) 333-7408 
march@cs.uiuc.edu		                          
{uunet,convex,pur-ee}!uiucdcs!march                      
"Emotions are alien to me.  I'm a scientist." -- Spock, "This Side of Paradise"
===============================================================================



	

mike@shogun.cc.umich.edu (Michael Nowak) (08/05/89)

In article <JGREELY.89Jul29102907@oz.cis.ohio-state.edu> J Greely <jgreely@cis.ohio-state.edu> writes:
>In article <MCCALPIN.89Jul28133612@masig2.ocean.fsu.edu> mccalpin@masig2.ocean.fsu.edu (John D. McCalpin) writes:
>>I have heard that it is possible to run sun3 binaries on the NeXT
>>(at least under 0.9).
>
>Since this one keeps coming up, I'll trash it publicly.  The ability
>to run Sun 3 binaries was a feature of Mach that was supported under
>0.8.  It went bye-bye in 0.9.  Having been removed, the chances of it
>reappearing are slim to none (leaning towards none, I'm sure).
>J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)

Under 0.9, you can use the command "atom" to convert some Sun binaries
to NeXT binaries.  I believe the syntax is:

atom <sun3binary> <nextbinary>



 -----------------------------------------------------------------------------
 Michael Nowak                                          ...mailrus!shogun!mike
 Workstation Consultant                               mike@shogun.cc.umich.edu
 U of M Computing Center User Services              Mike_Nowak@um.cc.umich.edu

    ...working for but in no way representing the University of Michigan...