Article View: gnu.gcc.help
Article #52783Re: Mixing cc and gcc code at link time in SunOS4.1
From: Michael Salmon
Date: Wed, 20 May 1992 08:21
Date: Wed, 20 May 1992 08:21
33 lines
2271 bytes
2271 bytes
In article <1992May19.205623.1@tesla.njit.edu>, erh0362@tesla.njit.edu (Elliotte Rusty Harold) writes: |> |> How well does code compiled with gcc 2.1 integrate with code |> compiled with the bundled cc on a SPARC? I've got a heavily |> mathematical program split across four source files. If I compile all |> four source files with either cc or gcc, the program runs fine and |> gives correct results for a case I'm able to check analytically. I'd |> like to compile three of the pieces with gcc because in general its |> faster and allows me to use ANSI standard code and one with cc to take |> advantage of the -fsingle flag that doesn't seem to have a gcc |> equivalent. However the code created by the hybrid objects produces |> erroneous results. Can I link together code produced by gcc with code |> from other compilers? If so do I need to do anything more than "gcc |> file1.o file2.o file3.o file4.o -lm"? Will this work if I get the gnu |> linker? If I can't link gcc code produced by the bundled cc compiler, |> can I link with code produced by f77? I'm using a Sparc II running |> SunOS 4.1.1. This could be a problem with function return values, so try -fpcc-struct-return. However if I remember correctly isn't -fsingle obsolete with ANSI C where floats aren't promoted to doubles. My memory is a bit hazy here but I seem to recall there being problems with prototypes in early ANSI C compilers. -- Michael Salmon #include <standard.disclaimer> #include <witty.saying> #include <fancy.pseudo.graphics> Ericsson Telecom AB Stockholm
Technical Details
Message-ID:
<1992May20.082113.4820@ericsson.se>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic2!ericom!eos.ericsson.se!etxmesaReferences:
<1992May19.205623.1@tesla.njit.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,44cf45eb3a03d53b X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-05-19 20:38:16 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic2!ericom!eos.ericsson.se!etxmesa From: etxmesa@eos.ericsson.se (Michael Salmon) Subject: Re: Mixing cc and gcc code at link time in SunOS4.1 Message-ID: <1992May20.082113.4820@ericsson.se> Sender: news@ericsson.se Nntp-Posting-Host: eos6c02.ericsson.se Reply-To: etxmesa@eos.ericsson.se (Michael Salmon) Organization: Ericsson Telecom AB References: <1992May19.205623.1@tesla.njit.edu> Date: Wed, 20 May 1992 08:21:13 GMT Lines: 33