From: Lee <ler762@gmail.com>
To: cygwin@cygwin.com
Subject: converting from -mno-cygwin
Date: Tue, 26 Apr 2016 23:06:00 -0000 [thread overview]
Message-ID: <CAD8GWsuVECqpUX6_BDnKq+ueU8svKXqzG9BWHNOCj4P=e4aDyQ@mail.gmail.com> (raw)
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
next reply other threads:[~2016-04-26 21:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 23:06 Lee [this message]
2016-04-27 0:32 ` JonY
2016-04-27 5:36 ` Lee
2016-04-27 12:49 ` JonY
2016-04-28 21:17 ` Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAD8GWsuVECqpUX6_BDnKq+ueU8svKXqzG9BWHNOCj4P=e4aDyQ@mail.gmail.com' \
--to=ler762@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).