Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!att!pegasus!hansen From: hansen@pegasus.ATT.COM (Tony L. Hansen) Newsgroups: comp.lang.c++ Subject: Re: cross-compilation Summary: what you need to do cross-compilation Keywords: CC, cross-compilers, c++ Message-ID: <3216@pegasus.ATT.COM> Date: 25 Oct 88 15:20:07 GMT References: <5180@saturn.ucsc.edu> <468@otc.oz> Reply-To: hansen@pegasus.att.com (XT1554000-Tony L. Hansen;LZ 3B-315;3207) Organization: AT&T Bell Laboratories, Lincroft, NJ Lines: 38 > I am trying to cross-compile C++ on a CRAY, [...] > This leaves me with the following routines undefined: > _main _new _delete To do C++ (cfront-based) cross-compilation, you will need these things: o a set of C cross-compilation tools, which would include cc, ld, ar, nm o a size-alignment table for the remote machine as created by the szal program run on that remote machine o a copy of cfront running locally o a version of CC which invokes the cross-compilation versions of cc, ld, and nm. It needs to invoke cpp with the options appropriate to the remote machine, such as "-U local-machines-symbol" and "-D cray". The size-alignment table used should be the one mentioned above. o Using this version of CC, you need to create a local copy libC.a. Compile all of the .c files into .o files, using the -c option to CC, and use the cross-compilation version of ar to create libC.a. If you don't have a version of ar, ship the .o's across to the remote machine, do the ar there, and ship the libC.a back. o Now modify CC again so that it points to the cross-compilation version of libC.a. o You might have to modify the munch/patch line to work with your systems output from nm. The new version of CC should now be usable for doing a complete cross-compilation of C++ programs. I've used the above technique for doing cross-compilation to several other systems. Tony Hansen att!pegasus!hansen, attmail!tony