This is the mail archive of the
cygwin
mailing list for the Cygwin project.
converting from -mno-cygwin
- From: Lee <ler762 at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 26 Apr 2016 17:08:55 -0400
- Subject: converting from -mno-cygwin
- Authentication-results: sourceware.org; auth=none
I'm trying to get privoxy (https://sourceforge.net/projects/ijbswa/)
to build under the current cygwin.
It works using cygwin 1.5 + gcc v3 -mno-cygwin & I was hoping it would
be relatively easy to get it working using the cross-compiler
toolchain. But I keep getting stuck :(
$ make
i686-w64-mingw32-gcc -mwindows -mwin32 -o privoxy.exe actions.o
cgi.o cgiedit.o cgisimple.o deanimate.o encode.o errlog.o filters.o
gateway.o jbsockets.o jcc.o list.o loadcfg.o loaders.o miscutil.o
parsers.o ssplit.o urlmatch.o client-tags.o w32log.o w32taskbar.o
win32.o w32svrapi.o w32.res pcrs.o pcre/get.o pcre/maketables.o
pcre/study.o pcre/pcre.o pcre/pcreposix.o -lws2_32 -lz -lwsock32
-lcomctl32 -lpthreadGC2
/usr/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld:
cannot find -lpthreadGC2
collect2: error: ld returned 1 exit status
GNUmakefile:727: recipe for target 'privoxy.exe' failed
make: *** [privoxy.exe] Error 1
I tried changing the make file to
# PThreads library, if needed.
PTHREAD_LIB = -lpthread
and it builds without error, but run it and it complains about
This application has failed to start because libwinpthread-1.dll was not found.
So copy libwinpthread-1.dll & zlib1.dll to the directory where I've
got privoxy.exe and it actually works! Or at least hasn't crashed yet
:)
Questions:
How to tell if I should be using libwinpthread or pthread? I had no
idea so installed both:
/usr/i686-w64-mingw32/sys-root/mingw/bin
$ ls -l *hread*
-rwxr-xr-x 1 root None 47635 Apr 7 08:54 libwinpthread-1.dll
-rwxr-xr-x 1 root None 65024 Jul 6 2013 pthreadGC2.dll
If I should be using the pthread library, what's the correct library
name to give GCC - ie. in the make file,
PTHREAD_LIB = ??what??
Is there a way to get the libraries included as part of the
executable? I'd rather not have to include libwinpthread-1.dll &
zlib1.dll in the distribution package.
Is there a standard way to figure out if the compiler is gcc-v3 with
the -mno-cygwin flag set?
I had to make a few changes to the code to get this far & I'd prefer
to have the changes wrapped inside an #IFDEF or something. For
example, I just commented out the include since it conflicts with
something
#ifdef __MINGW32__
/* -LR- #include "cygwin.h" */
/* -LR- const char cygwin_h_rcs[] = CYGWIN_H_VERSION; */
#endif
Under cygwin 1.5, gcc -mno-cygwin requires cygwin.h to be included.
Using i686-w64-mingw32-gcc if cygwin.h is inculded gcc barfs with a
conflicting definition of [i don't remember].
It'd be nice if I could build using the old or new method without
having to change the source code, so I'm guessing I want some kind of
ifdef wrapper for the include??
TIA,
Lee
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple