www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/22/16:35:01

From: elf AT netcom DOT com (Marc Singer)
Message-Id: <199604222026.NAA07251@netcom16.netcom.com>
Subject: Re: Standard 32-bit libraries
To: d DOT love AT dl DOT ac DOT uk (Dave Love)
Date: Mon, 22 Apr 1996 13:26:51 -0700 (PDT)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP List Alias)
In-Reply-To: <199604221746.SAA20454@djlvig.dl.ac.uk> from "Dave Love" at Apr 22, 96 06:46:38 pm
Mime-Version: 1.0

> Given that I can, in principle, link against the object files, I have
> no idea (a) whether the argument-passing conventions of the two
> compilers are the same (b) whether they do different name-mangling (c)
> whether they have the same ideas about the standard library (d) other
> things I might not be aware of -- though, of course, I can find the
> answers for the djgpp side.

While you may be able to get the compilers to agree on calling
conventions, you will need to reduce the interface to C.  Many
compilers do strange things with C++ calling for the sake of
efficiency.  For example, MS will use a register for the this pointer
which can cause problems when linking C++ to external C that does not
preserve that register.  Albeit a bug.

> Am I missing the fact that such things are actually defined by the
> formats or the architecture involved, perhaps?  I got the impression
> that the 32-bit DOS proprietary compilers weren't interoperable
> anyway, judging by the library variations on offer.

AFIK there is agreement about how standard C (__cdecl) works.  Best
way to figure this one out is to try to solve a linking problem.  Note
that file formats are another issue.  GCC uses COFF, which is supposed
to be portable, but this turns out to be untrue.  COFF is not always
COFF.  I'm doing work with some Macintosh libraries, porting a Win32
application using the MS compiler.  Everyone claims to be using COFF,
but the files won't link.

> Thanks for any further enlightenment and your efforts in general,
> which make the DOG world rather more bearable :-).

When in doubt, write it yourself or get some source code.  Sometimes a
tough solution but it is one that can be solved.

Marc Singer

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019