delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/22/12:05:16

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
X-Trace: 65329041/mk-filter-2.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/79.74.17.85
X-SBRS: None
X-RemoteIP: 79.74.17.85
X-IP-MAIL-FROM: johne53 AT tiscali DOT co DOT uk
X-IP-BHB: Once
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AqYEAL1/rkhPShFV/2dsb2JhbACDf0eyDoFo
X-IronPort-AV: E=Sophos;i="4.32,252,1217804400"; d="scan'208";a="65329041"
Message-ID: <004401c90479$07c2ca50$4001a8c0@mycomputer>
From: "John Emmas" <johne53 AT tiscali DOT co DOT uk>
To: <cygwin AT cygwin DOT com>
References: <4126b3450808220352y12a25fddi444e3df3e1cb590a AT mail DOT gmail DOT com> <002f01c90456$1f080e50$4001a8c0 AT mycomputer> <5E25AF06EFB9EA4A87C19BC98F5C8753014F88E0 AT core-email DOT int DOT ascribe DOT com> <20080822151916 DOT GB13113 AT ednor DOT casa DOT cgf DOT cx>
Subject: Re: Cygwin compiler and linker options
Date: Fri, 22 Aug 2008 17:03:41 -0000
MIME-Version: 1.0
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Guys,

Whilst I only signed up to this mailing list a couple of days ago, I can
naturally understand your frustration if this topic ( -mno-cygwin) is
dropping up over & over again and (apparently) being widely misunderstood.
What I don't accept is that you have any right to castigate people for not
understanding something which has clearly never been explained particularly
well.  Why am I arrogant enough to believe that it's never been explained
very well?  Well, that seems self-evident if there's such a widespread
misunderstanding of the topic.  Here's a link to the item that I read this
morning:-

http://www.mail-archive.com/cygwin AT cygwin DOT com/msg49102.html

Note that it states:-
" Cygwin compilers normally create Cygwin executables, ie. executables that
require the Cygwin DLL to run. But they don't have to. The compilers that
come with the Cygwin package (gcc, g77 etc.) accept an "-mno-cygwin" switch.
This causes them to create executables that do *not* rely on the Cygwin DLL"

There's nothing at all there about cross-compilation and even if you read
the entire text, there's no indication that the writer himself had any
understanding that -mno-cygwin is applicable to cross-compilation.  In fact,
any developer would probably conclude from the above that -mno-cygwin is
some kind of switch that invokes static, rather than dynamic linking (thus
dispensing with the need for cygwin1.dll).  That was my first assumption and
I came to that conclusion because the writer's explanation was wholly
inadequate (which isn't actually MY fault).

In fact, that's precisely WHY I was asking if there was a more authoritative
resource.

John


----- Original Message ----- 
From: "Christopher Faylor" <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: <cygwin AT cygwin DOT com>
Sent: 22 August 2008 15:19
Subject: Re: Cygwin compiler and linker options


> On Fri, Aug 22, 2008 at 03:52:35PM +0100, Phil Betts wrote:
>>John Emmas wrote on Friday, August 22, 2008 1:54 PM::
>>
>>> Just doing some searches on the internet, there seems to be an awful
>>> lot of misinformation / misunderstanding about what the various
>>> Cygwin-gcc compiler and linker flags do.
>>>
>>> For example, I saw one article that said that that flag -mno-cygwin
>>> causes an executable to be generated which does *not* require
>>> cygwin1.dll to be present on the host machine.  That doesn't seem to
>>> be true (I've tried it).
>>
>>If you link with cygwin DLLs, it is the DLLs that require cygwin1.dll,
>>not the executable.  If you compile with -mno-cygwin, do not link with
>>any cygwin DLLs.  You wouldn't link with a cygwin DLL if you were
>>cross-compiling for Linux; the -mno-cygwin is essentially specifying
>>a cross-compilation for a cygwin-free architecture.
>>
>>Think of it like this:
>>  gcc -mvegan spaghetti.c -o meal -lparmesan
>>will not give you a vegan meal.
>>
>>
>>$ cat >hw.c <<'EOF'
>>> #include <stdio.h>
>>>
>>> int main (int argc, char **argv)
>>> {
>>>     puts ("Hello World");
>>>     return 0;
>>> }
>>> EOF
>>$ gcc -mno-cygwin hw.c -o hw.exe
>>$ cygcheck ./hw.exe
>>.\hw.exe
>>  C:\WINDOWS\system32\msvcrt.dll
>>    C:\WINDOWS\system32\KERNEL32.dll
>>      C:\WINDOWS\system32\ntdll.dll
>>$ ./hw.exe
>>Hello World
>>$
>>
>>I see no trace of cygwin1.dll in the cygcheck output.
>>
>>
>>> I saw another article which said that if you
>>> don't use the flag -mwindows, a DOS terminal will open every time you
>>> launch your app.  That doesn't seem to be true either (at least, not
>>> on my machine).
>>
>>How are you launching it?  If you're doing it from a prompt, there's no
>>need to open another window.  If you double-click on it in an Explorer
>>window, you WILL get a DOS box unless you specified -mwindows.  Try the
>>above example and double click on it.  You'll get a DOS box flash up
>>momentarily.  Recompile using -mwindows, and you won't.
>>
>>> Is there any resource available where I can find out some
>>> (authoritative) information about what the various flags actually do?
>>
>>From the examples you've given, it seems you've already found some
>>authoritative information, but instead of doubting your ability to
>>comprehend, you've chosen to doubt the words of others and criticize
>>them in a public forum without providing any evidence to back up your
>>assertions.  Not only is that arrogant, but now YOUR misinformation /
>>misunderstanding is out there to cause confusion for others.
>>
>>It would be nice if the cygwin-specific options were documented in the
>>gcc info file, but they don't appear to be.  Don't expect -mno-cygwin
>>to appear there soon either, because my understanding is that the
>>-mno-cygwin option will be removed soon because of the surprising
>>number of people who can't seem to grasp the concept of no-cygwin.
>
> Phil is 100% correct here.  It's heartening to see someone so thoroughly
> getting it after having to so frequently deal with the misconceptions
> about -mno-cygwin.  Confusion about -mwindows is new though.
>
> I'm counting the days until -mno-cygwin disappears.  It is a blight that
> must be expunged.  I know that as soon as it is gone there will be a
> general wail from people who use it but it really should never have been
> implemented.
> --
> Christopher Faylor spammer? -> aaaspam AT sourceware DOT org
> Cygwin Co-Project Leader
> Netapp, Inc.
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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