Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!SAUNA.HUT.FI!jkp From: jkp@SAUNA.HUT.FI (Jyrki Kuoppala) Newsgroups: gnu.gcc Subject: Gcc as a cross-compiler Message-ID: <8907272001.AA27176@cs.hut.fi> Date: 27 Jul 89 20:01:52 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Helsinki University of Technology, Finland. Lines: 38 I've been using gcc and gas as a cross-compiler hosted on a Sparc and targetting for the m68k and vax architectures. Things seem to work pretty smoothly; the GNU linker ld still needs work to make it work in a cross-compilation environment, but GCC and GAS apparently do an excellent job. A couple of minor bugs that bit me: - gcc (version 1.35.95) complains about the '-bprefix' switch even though it's documented. Also, it seems to drop the -O switch if -b is used; I didn't check this thoroughly, I just stopped using -b. - LINK_SPEC is defined in the xm file xm-sunos4.h. I think this is incorrect. Gcc produces object files for the target architecture, so also the linker should be given the options which the target machine requires. LINK_SPEC should be moved to the tm.h file. In the gcc documentation, there's a comment about the macros REAL_VALUE_TYPE, REAL_VALUES_EQUAL (X, Y), REAL_VALUES_LESS (X, Y), REAL_VALUE_LDEXP (X, SCALE) and REAL_VALUE_ATOF (STRING) which should be defined if gcc is targetting to a machine with a different floating point hardware. Is there a reason why could not be used always ? I wouldn't think it would performance that much to use them always, and it would make gcc able to generate code for any target machine running on any host machine. Gas already does an excellent job of handling floating-point numbers in a machine-independent way. It also seems to have most of the code needed to implement the macros required by gcc, so that stuff could probably be merged to gcc. I think it should be possible to write the macros so that no parametres to the tm.h needs to be added; hard-params in the gcc 1.35.95 seems to provide all the needed information. If you are interested in that kind of portability improvement and it isn't being done already, I could do some work on it. //Jyrki