Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: 1run C++,Fortran,Ratfor makes



Sean Bennett <sean@example.com> wrote,

> "Stephen J. Turnbull" wrote:
> 
> > ...Many people who want to use GCC
> > for some reason on various systems do so, but then let the system's ld
> > program link the output of the various compilers into a single
> > executable object.
> 
> This sounds to be what the client was refering to - linking various object
> files into a single executable object module...
> 
> linux's linker is 'ld';  am I correct in assuming Sun's is MRI??  'info ld'
> makes reference to aiding users in 'the transition to GNU `ld' from the MRI
> linker'...

I worked on SunOS for about 7 years, and I mean I wrote
software on SunOS, and I always used `ld' to link my
programs.  I am not sure what MRI is, but I can assure you
that on SunOS you link with `ld'.  Any compiler writer in
his or her right mind will generate object files on a Un*x
system that can be processed by the standard `ld' of that
system.[1]  This implies that you can link object files of
different compiler into one executable.

The problem is, as Steve already pointed out, that different
programming languages uses different conventions on how to
organize arguments to functions etc in memory, which can
make interfacing different languages tricky.  *But* this is
much more a language than OS issue and the common
denominator on Un*x systems is that usually every language
provides support for the calling conventions used by C (and
if two languages have one supported calling convention in
common, this is usually enough to get the job done - in the
worst case by using some additional marshalling code in C).
In other words, when it worked on SunOS, it'll probably also 
work on Linux (it depends on the different versions of the
compilers on the different OSes).

> > The question about the single `make' command puzzles me as
> > it does Steve.
> 
> after a quick study care of Turnbull, Chakravarty, and O'reilly&Ass., and a
> somewhat better understanding of the compile/linking process, I think they
> were refering to producing a single object file after
> 'making' and linking the various source files...

As I said, I don't expect any problems there, because the
different compilers use the same linker and object format
anyway.

> > There might be one problem though, what kind of Fortran does
> > you client need (F77, F90)?
> 
> f77 I believe...

This definitely makes it easier (and cheaper ;-)   Maybe g77
does the job.  I'd try running some of their sources through
g77.  Actually, for a kind of simple fesability study, your
client could install gcc/g++ and g77 on their Suns and try
to compile their stuff with it (there are CDs with the GNU
tools precompiled for Suns).  This would also allow them to 
compare the performance of the generated code (if this is an 
issue).  If this works, it'll also work on Linux.

Cheers,

Manuel

[1] Actually, anybody in the right mind will generate C or
    symbolic assembler code (.s files), which will be
    assembled into object files (.o) by `as', the assembler,
    which guarantees that the files are in absolutely the
    same format.
-------------------------------------------------------------------
Next Nomikai: 14 January 1999, 19:30 Tengu TokyoEkiMae 03-3275-3691
*** it will will be Jan 14 (Thu), as Jan 15 (Fri) is a natl holiday
Next Technical Meeting: Feb 13 (Sat), 12:30    ace: Temple Univ.
-------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links