public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: gcc -mno-cygwin creates cygwin executables!
@ 2001-12-11 13:43 a.rburgers
  2001-12-12  4:27 ` Robert Collins
  0 siblings, 1 reply; 14+ messages in thread
From: a.rburgers @ 2001-12-11 13:43 UTC (permalink / raw)
  To: cygwin

Rob Collins wrote:

> > 1) Move the pthread functions from libcygwin.a to a separate library
> > libpthread.a instead of libpthread.a being a symlink to libcygwin.a.
> > That
> > would fix this particular configure problem I think. This already
> > works this way I found for libpng.a and libjpeg.a.

> No, as the pthread functions use cygwin calls that will still link to
> cygwin.

Yes! Since if you use gcc without -mno-cygwin, libcygwin.a is linked in 
anyway,
as is the case now with for instance libpng.a and libjpeg.a.

I only want the link to fail when you use gcc -mno-cygwin. It doesn't now
since linking with -lpthread links in all of libcygwin.a

> If you want a mingw pthread library see the pthread-win32 project.

I don't want to force the user to install pthread-win32.
I want this configure script (for fltk btw) to detect correctly whether 
threads
are available or not.

> > 2) Put some cygwin specific libraries as libpthread.a in
> /usr/cygwin/lib
> > and add /usr/cygwin/lib to the specs?

> This _might_ do it. Still it requires breaking out the pthread
> functions, for little benefit and greater overhead.

I don't see the problem with this. We are not adding libraries as libpng
and libjpeg to libcygwin either are we?

> Why not add the
> win32-pthread functions somewhere and add that to the -mno-cygwin specs?

You mean adding the win32-pthread functions to the standard cygwin mingw 
distribution?
That would be perfect of cause!

Teun


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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: gcc -mno-cygwin creates cygwin executables!
@ 2001-12-12 15:20 Teun Burgers
  0 siblings, 0 replies; 14+ messages in thread
From: Teun Burgers @ 2001-12-12 15:20 UTC (permalink / raw)
  To: cygwin, drobinow

David wrote:

> I must say I'm baffled by this whole thread (NPI)
> Why are you using such a lame program.

If you look at a configure script, you will find that
autoconf uses these "lame programs" to check for libraries.

> Just add
>  #include <pthread.h>
> to zz.c and everything should work as intended, no?
> If you don't do that it seems you get what you deserve.
> Am I missing something?

Yes you are :)

Teun

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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: gcc -mno-cygwin creates cygwin executables!
@ 2001-12-12 14:31 Robinow, David
  0 siblings, 0 replies; 14+ messages in thread
From: Robinow, David @ 2001-12-12 14:31 UTC (permalink / raw)
  To: cygwin

 I must say I'm baffled by this whole thread (NPI)
Why are you using such a lame program.
 Just add
  #include <pthread.h>
to zz.c and everything should work as intended, no?
 If you don't do that it seems you get what you deserve.
Am I missing something?

-----Original Message-----
From: Teun Burgers [mailto:a.rburgers@freeler.nl]
Sent: Wednesday, December 12, 2001 2:51 PM
To: cygwin@cygwin.com
Cc: Robert Collins
Subject: Re: gcc -mno-cygwin creates cygwin executables!


To sum up this thread:

consider the following program:

main () {
        pthread_create();
}

gcc -mno-cygwin -o zz.exe zz.c -lpthread will compile and build.
A cygcheck on zz.exe reveals that libcygwin.a is linked in. The
problem with this is that a configure script with CC='gcc -mno-cygwin'
will incorrectly find that libpthread.a is available with
AC_SEARCH_LIBS(pthread_create, -lpthread)


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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: gcc -mno-cygwin creates cygwin executables!
@ 2001-12-12 13:54 Steve Jorgensen
  0 siblings, 0 replies; 14+ messages in thread
From: Steve Jorgensen @ 2001-12-12 13:54 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'


On Wednesday, December 12, 2001 1:10 PM, Christopher Faylor 
[SMTP:cgf@redhat.com] wrote:
> On Wed, Dec 12, 2001 at 09:55:25PM +0100, Teun Burgers wrote:
> >egor duda wrote:
> >
> >> you're fixing specific symptoms instead of the problem itself. this
> >> had been discussed already and the general consensus (at least as i
> >> understand it) is the following: -mno-cygwin is a _hack_. it's
> >> supposed to be used only when absolutely necessary and when you
> >> absolutely know what you're doing.
> >
> >-mno-cygwin certainly is very good hack. I hoped I was contributing
> >to making it an even better hack.
>
> If you want to contribute to it, then contribute to what I described in
> my original message -- fix 'ld' so that it doesn't have to search 
/usr/lib
> by default.
>
> Anything else you've proposed has just been a workaround.  I am really
> not going to subvert the current cygwin DLL layout to accomodate
> -mno-cygwin.  Or, let me amend this in the usual way.  If you think that
> this is a good idea, send a patch which accomplishes your idea.
> Otherwise, I guarantee you that this idea will go nowhere.
>
> Speaking of going nowhere, -mno-cygwin is not going anywhere either.  It
> will always be around.  However, I like to dream that the only thing
> this option will do is to invoke a i686-pc-mingw32-gcc compiler.
>
> Otherwise, I fear that we'll always be suffering from cross-pollution 
from
> the cygwin libraries.
>
> Although, sadly, if cygwin and mingw exist on the same machine, we'll
> *always* be getting "bug reports" from people who complain that
> constructions like:
>
> i686-pc-mingw-gcc -o foo.exe -Ic:/cygwin/usr/include/signal.h foo.c
>
> doesn't work right!!!!
>
> >>*** if you want to build executables for mingw platform you should use
> >>mingw toolchain, either native or cross.  ***
> >
> >setup.exe is a huge success of cause and makes things very easy to
> >install.  I have never looked at the mingw toolchain, but I bet the
> >cygwin stuff is a lot easier to install.
> >
> >And with a bit of attention paid to the configure script a package can
> >build out-of-the box with gcc -mno-cygwin.  This is much better than
> >the often ill maintained mingw specific makefiles, if they are there at
> >all.
>
> That may be, but -mno-cygwin is a decidedly low-priority goal for the 
Cygwin
> project.  The primary reason is that we don't have anyone other than me
> "interested" in supporting it.

Personally, I think the hope of being able to use configure for compiling a 
native w32 executable is a very important capability to have whether it is 
through Cygwin or not.  Is that likely to be possible any other way than 
through Cygwin?  If there's a better answer on the horizon, I'd like to 
know about it.

Eventually, I'm hoping to be able to compile GNOME apps for native Windows, 
and I see anything that takes autotools out of the loop as 
counterproductive.  It would mean that I would always have to play catch-up 
to make newer versions work.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: gcc -mno-cygwin creates cygwin executables!
@ 2001-12-11 13:09 Teun Burgers
  2001-12-11 13:22 ` Robert Collins
  0 siblings, 1 reply; 14+ messages in thread
From: Teun Burgers @ 2001-12-11 13:09 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

>  On Tue, Dec 11, 2001 at 06:47:09PM +0100, Teun Burgers wrote:
> >1) gcc -mno-cygwin searches for libs in /usr/lib.
> >   Should it?

> It shouldn't, but it does.  Changing this requires a complicated change
> to 'ld'.  I don't think that anyone is contemplating such a change.
>
> The only alternative is to use the mingw version of the tools.

I can think of a few other perhaps simpler alternatives.

1) Move the pthread functions from libcygwin.a to a separate library
libpthread.a instead of libpthread.a being a symlink to libcygwin.a.
That
would fix this particular configure problem I think. This already
works this way I found for libpng.a and libjpeg.a.

2) Put some cygwin specific libraries as libpthread.a in /usr/cygwin/lib
and add /usr/cygwin/lib to the specs?

Teun Burgers

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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* gcc -mno-cygwin creates cygwin executables!
@ 2001-12-11  9:48 Teun Burgers
  2001-12-11 12:14 ` Christopher Faylor
  0 siblings, 1 reply; 14+ messages in thread
From: Teun Burgers @ 2001-12-11  9:48 UTC (permalink / raw)
  To: cygwin

Consider the following 3 line program:

main () {
        pthread_create();
}

This compiles and links with

gcc -mno-cygwin -o zz zz.c -lpthread

It should not link since this is part of a configure test for threads
AC_SEARCH_LIBS(pthread_create, -lpthread) that should
fail with CC='gcc -mno-cygwin'

There are 2 problems here:

1) gcc -mno-cygwin searches for libs in /usr/lib.
   Should it?

2) libpthread.a is link to libcygwin.a. If the
   thread routines were in a separate library the link
   would still fail as it should.

Teun Burgers

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

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

end of thread, other threads:[~2001-12-12 22:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-11 13:43 gcc -mno-cygwin creates cygwin executables! a.rburgers
2001-12-12  4:27 ` Robert Collins
2001-12-12 12:15   ` Teun Burgers
2001-12-12 12:30     ` egor duda
2001-12-12 13:10       ` Teun Burgers
2001-12-12 13:42         ` Christopher Faylor
2001-12-12 14:01     ` Robert Collins
  -- strict thread matches above, loose matches on Subject: below --
2001-12-12 15:20 Teun Burgers
2001-12-12 14:31 Robinow, David
2001-12-12 13:54 Steve Jorgensen
2001-12-11 13:09 Teun Burgers
2001-12-11 13:22 ` Robert Collins
2001-12-11  9:48 Teun Burgers
2001-12-11 12:14 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).