Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ncar!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!pyrltd!pyra.co.uk!keyvan From: keyvan@pyra.co.uk (Keyvan Shirnia Pre Sales) Newsgroups: comp.sys.pyramid Subject: Re: Makeing "Gated" Keywords: Gated Message-ID: <671359169.AA5849@flaccid> Date: 11 Apr 91 08:39:29 GMT References: <1991Apr8.073344.2646@cheops.qld.tne.oz.au> <671136511.AA15442@flaccid> <151385@pyramid.pyramid.com> <128287@uunet.UU.NET> Sender: news@pyra.co.uk (News system) Reply-To: keyvan@pyra.co.uk (Keyvan Shirnia) Organization: Pyramid Technology Ltd, Farnborough, ENGLAND Lines: 74 In article <128287@uunet.UU.NET> rbj@uunet.UU.NET (Root Boy Jim) writes: > >The Tahoe distribution has memory.h. > Memory.h might well be there, however, this is a superset of the *MAIN STREAM* UCB. I am not saying that Tahoe is not UCB, though :-) >>>I am not quite sure what kind of errors your are getting. However, the >>>first thing I would try out would be: (Type this in your ATT universe shell) >>> >>>cc -I/usr/.attinclude -I/usr/.ucbinclude gated.c -o gated /.ucblib/libc.a >>> >>>This line should pickup both the UCB and ATT include files. From the linking >>>point of view, since you are already in ATT universe /.attlib/libc.a is >>>automatically searched. But to be sure that you are not missing any UCB >>>routines add /.ucblib/libc.a . > >I am surprised someone from Pyramid suggested this, as it doesn't work. >Pyramid put some nasty stuff to keep you from cross-linking. I did try to say that this cc line *might* work. It is very difficult to figure out exactly what library routines you need to compile a piece of unknown code. You are right, however, that I should have stressed this fact! > >> In general, DON'T DO THIS! Cross universe linking can get very messy. > >It's only messy because Pyramid made it so. I pulled out the memory >stuff, getopt, and some string functions from Sequent's ATT libc.a >and put them in the UCB libc.a because I was tire of dealing with it. Well this is exactly what Sun have done. It's just another way of approaching the problem. I myself have ported many programs to Pyramid, and used the cross linking of the universes. I have only once come across such a problem, and that was with scanf(). > >>Doing >>the above (explicitly calling the ucb library) will cause all references >>that can be resolved from the ucb library to be. This is not supported, >>and can lead to very strange problems. Cross-linking may not be supportable, however, the original question was that the code did not compile under the att universe. I never said that the cc line would work. (I only suggested that it might work, or give some clues as to what the problem is) Programs cross referencing different universes are never portable. Neither is your own-built Sequent ucb libc.a which also contains some att routines. This it self is cross linking. The syntax might have changed but semmantically it is the same. > >> Note that occasionally this will work fine. You might not >>get bitten. But it is simply wrong in the general case. Even extracting >>the necessary modules from the other universe's library can be a >>problem - you need to check what referenced externals there are, and >>make sure they won't have problems in the other universe. > >Yes, things can get tricky, but if one goes to all the trouble of >doings so, one should not be thwarted by the vendors. Again I stress the point that if you are the programmer you should take this in to account. However, if you are trying to port a software across, then surely you have no choice. Well you can always rewrite the software, I guess! :-) Best regards, Keyvan -m------- Keyvan Shirnia Tel : +44 252 373035 ---mmm----- Pre Sales Support -----mmmmm--- Pyramid Technology Ltd. keyvan@pyra.co.uk -------mmmmmmm- Farnborough GU14 7NA, England.