This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is gcc a complete universal (not bound to any OS) c compiler?


NightStrike wrote:

> > GCC runs natively on windows under the Cygwin environment
> > (www.cygwin.com) and MinGW (www.mingw.org)
> >
> 
> It's not running natively if it's running under cygwin / mingw

That's total nonsense, of course it's native.  There is no interpreter,
no VM, no bytecode, etc.  This is a C compiler we're talking about.

With MinGW there is very little difference between it and Microsoft's
Visual Studio toolchain, minus the IDE parts of course.  They use the
same C runtime, provide access to the same Win32 API, the same COFF
object format, the same PE binary format, they implement the same ABI,
and (for C at least) object files and libraries are totally
interchangable/interoperable between the two toolchains.  They are
substantially similar from a high level viewpoint.

With Cygwin there is this so-called POSIX emulation, but this is not
emulation at the machine code or hardware level, it's at the API level,
meaning that Cygwin consists of a library, written in C and C++, that
implements functions that don't otherwise exist on Windows.  But this is
still just a library of code, same as any other library.  What's running
when you run a Cygwin binary is native machine code.  You can't, for
example, expect to load a linux ELF binary file and run it with Cygwin. 
The Cygwin DLL is a completely standard win32 DLL and Cygwin binaries
are standard Windows PE executables.

Often in the context of Cygwin, people will refer to "native Windows
apps" as being something different than Cygwin apps, but this is an
overloading of the word native.  In that context "native" simply means
"non using the Cygwin DLL", as in using the C library of the operating
system that MinGW uses (MSVCRT).  But it's still "native" code in that
there is no interpreter, no bytecode, nothing like what
VMware/Xen/Colinux does.

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]