delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/04/26/17:09:17

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; q=dns; s=default; b=yFhAkcdslDpnSHpUqi1+LOFdgUDVG
OnM8fHYvnrSphi50DtJwjH4E0tlhlj2WePV7G3eCaJ3eT5FyX+f+BdRcLWYplwjy
BhNUQft2j+c69DQSQ/d9WnsO7YkbaINK62WU7rxumgEtK93skhBbOXq5EsStnmHx
opCLQ/Kzw2MsHI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; s=default; bh=8gEnBSFiiKcZ821ljg3RnNykEv8=; b=PsN
bx68MzjAs74n+7YKy8LXu0p6YN2am/PZSZLz/Q7+34QzSDvyWfSLWE+BrR6Eu6X7
qtw/RTImeSBr4/qQqYOeCAjsFKb7u2nGcrEGnBg5PkOPKwE2WqZPYb2anpNfUjb9
fLDXEy/Cj7RFS/4b3CDC3AwgvoS5qUxUSxXk3jDc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Lee, jul, Jul, lee
X-HELO: mail-wm0-f50.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=z8WDIvoETmTMU1P52dTkMjmC1iFroCeuhMdo5oNJDBE=; b=Gsw9ItgxU2c+h0W2kZaM3gVZd6ILyq84Ya78WVf+q4BLlGqmKl8t0hZ5HBWOnWOH13 pBXxASgTqPlBqZYZnuX5bGs2rKDOI63a27sFVdGUsTqnycxhgLlAjwzs2QgLNO7bIrwQ xREa9M8RJldnknsD3oGBhSIn1hbAgjsxnE6a7+b+x7ooMm/vGsbHMfOQuvp8bFafR7kS K/vpYR2HDvK8sUoubKo6Qkkib0Chxd7G4s9K5ZFTpWHI+UHFZKc7sEqIta7AodZXr85t +zSQu8kAMoYWLLwuHunoU/pWKFmKmoyMjydqrLPR3/+04Fc9X/jcsp2ik3gs2acJRTb3 muTQ==
X-Gm-Message-State: AOPr4FVOy5FK/16onGfkS4+YLthH1VTTn2e7oUMDuAY4TKahpXPJehPNazaFIWMYhTqZBaHvFovEuP1HuQ5QXA==
MIME-Version: 1.0
X-Received: by 10.28.230.69 with SMTP id d66mr21213490wmh.73.1461704935803; Tue, 26 Apr 2016 14:08:55 -0700 (PDT)
Date: Tue, 26 Apr 2016 17:08:55 -0400
Message-ID: <CAD8GWsuVECqpUX6_BDnKq+ueU8svKXqzG9BWHNOCj4P=e4aDyQ@mail.gmail.com>
Subject: converting from -mno-cygwin
From: Lee <ler762 AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019