Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!rutgers!husc6!hao!noao!arizona!whm From: whm@arizona.edu (Bill Mitchell) Newsgroups: comp.unix.wizards Subject: multiple-machine executables for Suns? Message-ID: <1853@megaron.arizona.edu> Date: Tue, 4-Aug-87 04:02:53 EDT Article-I.D.: megaron.1853 Posted: Tue Aug 4 04:02:53 1987 Date-Received: Thu, 6-Aug-87 01:03:07 EDT Organization: U of Arizona CS Dept, Tucson Lines: 49 I find myself frequently inconvenienced by the incompatibilities between different Sun binaries. Sun-2 binaries will work on a Sun-3, but not vice-versa and I expect that Sun-4 binaries work iff they're on a Sun-4. A fairly straightforward solution to this problem seems to be to extend the executable format so that multiple executables can be contained in a single file. Thus, if you've got Sun-2s and Sun-3s lying around, it'd be nice to have an executable that contains both Sun-2 and Sun-3 versions of the same program. If you run it on a Sun-3, it fishes out the Sun-3 code and if you run it on a Sun-2, it fishes out the Sun-2 code. I asked someone at Sun about this and they said that although Sun had talked about it there were no plans for doing it at the current time. As the only specific reason for not doing this, he cited the extra disk space required for such a format. Here, disk space is much cheaper than programmer time and I'd gladly have binaries that are twice as big if I didn't have to worry about two different executables. As far as I've thought about it, it seems that it really wouldn't be hard to implement this. I might go so far as to say that it would make a good independent study project for a sharp student. A possible plan of attack: Fix the kernel to recognize the multiple format and ignore portions of the file intended for other machines. As with the kernel, fix programs that read a.out files to ignore portions for other machines. Produce a utility that will take one or more regular executables of different machine types and produce a multiple-machine executable. There's also the problem of object files, but since they're also a.out files, a lot of the stuff for them would just fall out. As far as production of multiple-machine object files is concerned, just modify the language front ends to accept a list of machines to compile for and then do each one in turn, adding each to the object file. Has anyone else done much thinking about this? Any implementation attempts? In some ways the current incompatibilities help Sun -- they provides some motivation to roll out Sun-2s and roll in Sun-3s, but on the other hand, it lessens (to near-zero for me) the motivation to roll in a Sun-4. Bill Mitchell whm@arizona.edu {allegra,cmcl2,ihnp4,noao}!arizona!whm p.s. If you've got something to say of interest -- post it; don't just mail it to me.