Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: cygwin@cygwin.com
X-Injected-Via-Gmane: http://gmane.org/
Path: not-for-mail
From: Andrew DeFaria <ADeFaria@Salira.com>
Subject: impure_ptr/Mingw and Cygwin
Date: Fri, 22 Nov 2002 17:08:33 -0800
Lines: 31
Message-ID: <3DDED511.7@Salira.com>
NNTP-Posting-Host: 206.184.204.2
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: main.gmane.org 1038013669 26391 206.184.204.2 (23 Nov 2002 01:07:49 GMT)
X-Complaints-To: usenet@main.gmane.org
NNTP-Posting-Date: Sat, 23 Nov 2002 01:07:49 +0000 (UTC)
Cc: Andrew DeFaria <ADeFaria@Salira.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en, ru, zh

I wish to use -mno-cygwin to produce an executable that can work without 
Cygwin installed. I have successfully done this before. Now I'm adding 
some functionality to my program and it is no longer working! I've 
worked it out such that it will compile and link but when my program 
runs it simply stops returning an exit code of 5. Running this under gdb 
produces a SIGSIGV Segmentation fault then you attempt to run it.

I've whittled it down to the bare minimum to reproduce the problem. 
Seems to me the problem is somewhere between newer versions of gcc 3.X 
and Mingw.

File: foo.c:

#include <stdio.h>
int main (void) {
  printf ("Hello World\n");
  fprintf (stderr, "%s\n", "Hello World 2");
}

$ gcc -g foo.c -mno-cygwin -I/usr/include -o foo -liberty -lcrtdll -lg
$ foo
$

Note that if I do not put -lg then I get:

/tmp/ccKAyr4S.o(.text+0x4b): In function `main':
/dview/defaria_2.0/salira/neopon/build/maketools/foo.c:4: undefined 
reference to `_impure_ptr'

Any ideas?




--
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/

