From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27167 invoked by alias); 17 Apr 2002 05:08:38 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 27117 invoked from network); 17 Apr 2002 05:08:32 -0000 Received: from unknown (HELO mta01-svc.ntlworld.com) (62.253.162.41) by sources.redhat.com with SMTP; 17 Apr 2002 05:08:32 -0000 Received: from nori ([62.252.188.228]) by mta01-svc.ntlworld.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with SMTP id <20020417050830.TQCD14788.mta01-svc.ntlworld.com@nori> for ; Wed, 17 Apr 2002 06:08:30 +0100 Received: from 127.0.0.1 (FROM= HELO=nori) by nori (62.252.188.228) with SMTP (DimWit 0.92) id <20020417050828.0000.nori@nori> for ; Wed, 17 Apr 2002 05:08:28 +0000 Message-ID: <001001c1e5cd$e95b5da0$e4bcfc3e@nori> From: "Sam Edge" To: References: Subject: Re: True Static Linking Date: Tue, 16 Apr 2002 22:09:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-SW-Source: 2002-04/txt/msg00868.txt.bz2 > (1) Is there a "-static" switch that statically links in cygwin1.dll? > (2) If not, how else can I solve this problem? I'm fairly new to Cygwin but from what I've picked up there is no static ve= rsion of the cygwin library available either binary or source. This is a de= liberate policy to try to ensure that all running Cygwin processes have the= same version loaded and are all using the same shared memory and other ker= nel objects that are required to simulate the UNIX/POSIX API on top of the = Win32 one. If your program really needs things like fork() or native Berkley sockets y= ou could get the source for Cygwin and patch it to generate your own static= version. I've no idea how difficult this might be and maintaining it with = newer versions would be a headache. (It may be that a DLL is required by th= e Win32 architecture for some of the features.) I doubt whether a simple stand-alone executable needs this. The first thing to do is to try the "-mno-cygwin" switch on gcc as well as = making everything else statically linked. You might get away with this prov= iding you're not relying on Cygwin-specific API calls or C++ standard templ= ate libraries. (Make sure you've used SETUP.EXE to install the mingw-runtim= e and w32api packages first.) If that's not enough, you can go to http://www.colomsat.net.co/freehost/ngi= raldo/cppcygwin.html to add the additional C++ STL. This has instructions f= or ensuring that you get what you need in a painless manner and can create = native Win32 applications with the Cygwin GCC tool chain and all the other = nice Cygwin=20 (The other approach is to avoid using Cygwin as the development environment= and to download the MinGW Win32-native GCC tols and libraries from http://= www.mingw.org/, although this shouldn't be needed if you've configued every= thing correctly in Cygwin.) MinGW relies on the Micrsoft MSVCRTx.DLL run-time libraries but these are p= retty much universal. There is in fact no such thing as completely static l= inkage under Windows since you always end up dynamically linking to SYSTEM3= 2, USER32, GDI32 and/or other "universal" Win32 system DLLs. The VC runtime= are pretty much in this category. --=20 Sam Edge -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/