comp.lang.ada
 help / color / mirror / Atom feed
* Windows: cygwin vs. GNAT mingw
@ 2002-01-02  4:14 Terry Westley
  2002-01-02  5:28 ` Gerhard Häring
  0 siblings, 1 reply; 7+ messages in thread
From: Terry Westley @ 2002-01-02  4:14 UTC (permalink / raw)


Has anyone successfully used Cygwin in a GNAT-compiled program?

It appears that you can successfully link with -lcygwin, but program will crash.

GDB says:
    Program received signal SIGSEGV, Segmentation fault.
    0x61002ac0 in _size_of_stack_reserve__ ()

I suspect that this has something to do with GNAT on Windows using mingw
and you can't build a program  with both cygwin and mingw.

Here's the smallest program that I tested on:

---------------------------------
#include <stdio.h>

int main (argc, argv)
  int argc;
  char **argv;
{
  printf ("hello cygwin\n");
}
---------------------------------

Compile with this command:

gcc -g -o testcygwin testcygwin.c -L C:/cygwin/lib -lcygwin

If I use the gcc that comes with GNAT, it fails as shown above.
If I compile with gcc that comes with cygwin, it works fine.

P.S. I'm resorting to cygwin because I can't find winserve.dll that
is required when linking with -lwinserve of mingw!

--
Terry Westley
westley@yahoo.com






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Windows: cygwin vs. GNAT mingw
  2002-01-02  4:14 Windows: cygwin vs. GNAT mingw Terry Westley
@ 2002-01-02  5:28 ` Gerhard Häring
  2002-01-02 18:57   ` Terry Westley
  0 siblings, 1 reply; 7+ messages in thread
From: Gerhard Häring @ 2002-01-02  5:28 UTC (permalink / raw)


Terry Westley schrieb im Artikel <nOvY7.725$gO5.400754@news1.news.adelphia.net>:
>  Has anyone successfully used Cygwin in a GNAT-compiled program?

Not me.

>  
>  It appears that you can successfully link with -lcygwin, but program will crash.
>  
>  GDB says:
>      Program received signal SIGSEGV, Segmentation fault.
>      0x61002ac0 in _size_of_stack_reserve__ ()
>  
>  I suspect that this has something to do with GNAT on Windows using mingw
>  and you can't build a program  with both cygwin and mingw.

Yup. I'd bet 10 ᅵ that it's not possible.

> [snip]

Never heard of that DLL, but Google asked me "Did you mean winsrv.dll".
Maybe this gets you on the right track.

IMO if you want to use GNAT with the Cygwin DLL, you'll first have to
port it to Cygwin. Might be a relatively easy port, though.

Dunno if that strange winserve.dll is worth it. Do you have it on your
system at all? Have you tried DependencyWalker on it?

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Windows: cygwin vs. GNAT mingw
  2002-01-02  5:28 ` Gerhard Häring
@ 2002-01-02 18:57   ` Terry Westley
  2002-01-02 19:17     ` Gerhard Häring
  0 siblings, 1 reply; 7+ messages in thread
From: Terry Westley @ 2002-01-02 18:57 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]


"Gerhard H�ring" <gerhard@bigfoot.de> wrote in message
news:slrna356iv.3nv.gerhard@lilith.hqd-internal...
> Terry Westley schrieb im Artikel
<nOvY7.725$gO5.400754@news1.news.adelphia.net>:
> >  Has anyone successfully used Cygwin in a GNAT-compiled program?
>
> Not me.
>
> >
> >  It appears that you can successfully link with -lcygwin, but program will
crash.
> >
> >  GDB says:
> >      Program received signal SIGSEGV, Segmentation fault.
> >      0x61002ac0 in _size_of_stack_reserve__ ()
> >
> >  I suspect that this has something to do with GNAT on Windows using mingw
> >  and you can't build a program  with both cygwin and mingw.
>
> Yup. I'd bet 10 � that it's not possible.
>
> > [snip]
>
> Never heard of that DLL, but Google asked me "Did you mean winsrv.dll".
> Maybe this gets you on the right track.

I saw this on Google too. But, it appears to be something else.

> IMO if you want to use GNAT with the Cygwin DLL, you'll first have to
> port it to Cygwin. Might be a relatively easy port, though.

Well, I'd really prefer to use mingw because a) it's already built into GNAT
and b) it is reportedly much faster than cygwin.  But, I'm stuck because I
can't get either one to work!

> Dunno if that strange winserve.dll is worth it. Do you have it on your
> system at all? Have you tried DependencyWalker on it?

I can't find it either on my system or anywhere on the net.

What is Dependency Walker?  Is that like cygcheck that tells me what dlls
are used by an executable?  Sort of like ldd in the unix world.

> Gerhard
> --
> mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
> web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
> public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
> reduce(lambda x,y:x+y,map(lambda
x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Windows: cygwin vs. GNAT mingw
  2002-01-02 18:57   ` Terry Westley
@ 2002-01-02 19:17     ` Gerhard Häring
  2002-01-02 23:11       ` Terry Westley
  0 siblings, 1 reply; 7+ messages in thread
From: Gerhard Häring @ 2002-01-02 19:17 UTC (permalink / raw)


Terry Westley schrieb im Artikel <6GIY7.257$Ov2.206578@news.uswest.net>:
> [snip]
> > [Gerhard:]
> > IMO if you want to use GNAT with the Cygwin DLL, you'll first have to
> > port it to Cygwin. Might be a relatively easy port, though.
>  
>  Well, I'd really prefer to use mingw because a) it's already built into GNAT
>  and b) it is reportedly much faster than cygwin.  But, I'm stuck because I
>  can't get either one to work!
>  
> > [Gerhard:]
> > Dunno if that strange winserve.dll is worth it. Do you have it on your
> > system at all? Have you tried DependencyWalker on it?
>  
>  I can't find it either on my system or anywhere on the net.

Then I don't get why you try to link against it. Do you have the import
library but not the DLL? If you don't have the DLL, you won't be able to
run the executable anyway!?

If so, in which form do you have the import library: .def, .lib or .a? I
could tell you then how to get this to work with GNAT.

>  What is Dependency Walker?  Is that like cygcheck that tells me what dlls
>  are used by an executable?  Sort of like ldd in the unix world.

Yup, eacatcly that, just with a GUI: http://www.dependencywalker.com/ -
a freeware utility formerly available from microsoft.com.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Windows: cygwin vs. GNAT mingw
  2002-01-02 19:17     ` Gerhard Häring
@ 2002-01-02 23:11       ` Terry Westley
  2002-01-02 23:28         ` Jeff Creem
  0 siblings, 1 reply; 7+ messages in thread
From: Terry Westley @ 2002-01-02 23:11 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]


"Gerhard H�ring" <gerhard@bigfoot.de> wrote in message
news:slrna36n6i.1jl.gerhard@lilith.hqd-internal...
> Terry Westley schrieb im Artikel <6GIY7.257$Ov2.206578@news.uswest.net>:

>> [Terry]
>> I can't find it (winserve.dll) either on my system or anywhere on the net.

> [Gerhard]
> Then I don't get why you try to link against it. Do you have the import
> library but not the DLL? If you don't have the DLL, you won't be able to
> run the executable anyway!?
>
> If so, in which form do you have the import library: .def, .lib or .a? I
> could tell you then how to get this to work with GNAT.

[Terry]
I am porting a Linux Ada program which has references to several unresolved
symbols,
such as getuid and getgid.  I used nm command to find these symbols in
winserve.a in
the mingw libraries of GNAT 3.13p.  So, I naively built and ran the executable,
only to
find that winserve.dll is missing from the GNAT mingw distribution and I can't
find it
anywhere else either.

I think my next step is to get the latest distribution of mingw and see if the
supplied
libraries will satisfy my unresolved symbols and if I can use GNAT to link them
into
my executable.

--
Terry Westley
westley@yahoo.com






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Windows: cygwin vs. GNAT mingw
  2002-01-02 23:11       ` Terry Westley
@ 2002-01-02 23:28         ` Jeff Creem
  2002-01-04 18:25           ` Terry Westley
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Creem @ 2002-01-02 23:28 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]


"Terry Westley" <westley@yahoo.com> wrote in message
news:soMY7.338$Ov2.322017@news.uswest.net...
>
> "Gerhard H�ring" <gerhard@bigfoot.de> wrote in message
> news:slrna36n6i.1jl.gerhard@lilith.hqd-internal...
> > Terry Westley schrieb im Artikel <6GIY7.257$Ov2.206578@news.uswest.net>:
>
> >> [Terry]
> >> I can't find it (winserve.dll) either on my system or anywhere on the
net.
>
> > [Gerhard]
> > Then I don't get why you try to link against it. Do you have the import
> > library but not the DLL? If you don't have the DLL, you won't be able to
> > run the executable anyway!?
> >
> > If so, in which form do you have the import library: .def, .lib or .a? I
> > could tell you then how to get this to work with GNAT.
>
> [Terry]
> I am porting a Linux Ada program which has references to several
unresolved
> symbols,
> such as getuid and getgid.  I used nm command to find these symbols in
> winserve.a in
> the mingw libraries of GNAT 3.13p.  So, I naively built and ran the
executable,
> only to
> find that winserve.dll is missing from the GNAT mingw distribution and I
can't
> find it
> anywhere else either.
>
> I think my next step is to get the latest distribution of mingw and see if
the
> supplied
> libraries will satisfy my unresolved symbols and if I can use GNAT to link
them
> into
> my executable.
>
> --
> Terry Westley
> westley@yahoo.com
>
>
>


Good luck but I suspect that will probably not work. The whole purpose of
mingw is to use only native win32 libraries.. Those are pretty unixy
sounding calls.

How many symbols are we talking about here? If it is a small number then
perhaps
you get to the first stage with dummy functions/procedures with appropriate
pragma exports in some with'd package.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Windows: cygwin vs. GNAT mingw
  2002-01-02 23:28         ` Jeff Creem
@ 2002-01-04 18:25           ` Terry Westley
  0 siblings, 0 replies; 7+ messages in thread
From: Terry Westley @ 2002-01-04 18:25 UTC (permalink / raw)


"Jeff Creem" <jeff@thecreems.com> wrote in message
news:PIMY7.50873$5W5.20365514@typhoon.ne.mediaone.net...

Referring to attempting to find getuid() and getgid() in the latest mingw
distribution, Jeff wrote:
> Good luck but I suspect that will probably not work. The whole purpose of
> mingw is to use only native win32 libraries.. Those are pretty unixy
> sounding calls.
>
> How many symbols are we talking about here? If it is a small number then
> perhaps
> you get to the first stage with dummy functions/procedures with appropriate
> pragma exports in some with'd package.

It didn't help.  Now I'm looking closely at each unresolved symbol to see
if I can do without it (if only temporarily to get an executable to test) or
substitute a GNAT.OS_Lib call or Win32 call or use dummy procedures
as you've suggested.

--
Terry Westley
westley@yahoo.com






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-01-04 18:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-02  4:14 Windows: cygwin vs. GNAT mingw Terry Westley
2002-01-02  5:28 ` Gerhard Häring
2002-01-02 18:57   ` Terry Westley
2002-01-02 19:17     ` Gerhard Häring
2002-01-02 23:11       ` Terry Westley
2002-01-02 23:28         ` Jeff Creem
2002-01-04 18:25           ` Terry Westley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox