Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!comp.vuw.ac.nz!am.dsir.govt.nz!tui.marcam.dsir.govt.nz!tony From: tony@tui.marcam.dsir.govt.nz (Tony Cooper) Newsgroups: comp.unix.aux Subject: Re: Using A/UX to build MacOS applications Message-ID: <1991Jun11.063627.7524@am.dsir.govt.nz> Date: 11 Jun 91 06:36:27 GMT References: <1991Jun8.052220.6157@am.dsir.govt.nz> <867@taniwha.UUCP> Sender: news@am.dsir.govt.nz Reply-To: sramtrc@albert.dsir.govt.nz Distribution: comp Organization: Applied Mathematics Group D.S.I.R. Lines: 36 In article <867@taniwha.UUCP>, paul@taniwha.UUCP (Paul Campbell) writes: |> |> |> 1) Is there a way to translate COFF into CODE resources? If there isn't, is |> |> there any real reason why I couldn't write such a beast? |> |> No not really, this is because most Unix compilers/linkers (including |> the A/UX ones) don't make position independant code (PIC), this is mostly |> because PIC code often runs slower (and data is a real pain). CODE resources |> need PIC code and a compiler that understands how to build an 'a5 world' |> I recomend you use MPW or some such I don't think this is true. I think PIC code is easy in A/UX, but maybe there are various degrees of PIC and maybe A5 globals mess things up. I wrote a DRVR resource using A/UX cc. I presume a DRVR needs PIC code. So I guess I was lucky that my code turned out to be PIC. Or was I? I don't know. But this is what I did: cc -O drvr.c ld -x -r -o drvr drvr.o -lmac -lat -lld -lmr -lc dumpcoff drvr .text > drvr.r where dumpcoff just does a hex dump of the .text part of drvr. Now since drvr has not been linked into an executable it is PIC is it not? Or maybe it is PIC as long as it has no global variables. In that case there is a way round that too so that globals (but not A5 globals) are stuck in the right place. And a bit of glue code can handle the case of A5 globals too. PIC code is important in Unix cos it's needed for things like dynamic linkers and shared libraries and whatnot. But I don't really know what I'm talking about. I don't know how long branches and various stuff like that is done. Cheers, Tony