From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3374 invoked by alias); 31 Oct 2013 19:46:45 -0000 Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org Received: (qmail 3356 invoked by uid 89); 31 Oct 2013 19:46:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 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 X-HELO: mail-wg0-f52.google.com Received: from mail-wg0-f52.google.com (HELO mail-wg0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 31 Oct 2013 19:46:44 +0000 Received: by mail-wg0-f52.google.com with SMTP id k14so3242005wgh.19 for ; Thu, 31 Oct 2013 12:46:40 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.85.39 with SMTP id e7mr860289wiz.7.1383248800814; Thu, 31 Oct 2013 12:46:40 -0700 (PDT) Received: by 10.216.139.130 with HTTP; Thu, 31 Oct 2013 12:46:40 -0700 (PDT) In-Reply-To: References: <5122CF4E.1050301@homemail.com.au> <51242375.1070904@homemail.com.au> Date: Thu, 31 Oct 2013 19:46:00 -0000 Message-ID: Subject: Re: feature request: not need to specify PTW32_STATIC_LIB for static usage possible ? From: Roger Pack To: Ross Johnson Cc: pthreads-win32@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013/txt/msg00018.txt.bz2 On 2/20/13, Roger Pack wrote: >> Sounds like you wanted to address this to the list but I think you >> replied only to me. > > oops, moving back on list...suggest the ML be modified so the default > reply-to is the ML :) > >> In Linux, the usual 'static' qualifier on declarations controls >> visibility, regardless of dynamic or static linking but is restricted to >> a file (or perhaps more accurately a compilation unit). If this isn't >> convenient then GCC 4 and above recognise __attribute__ >> ((visibility("hidden"))), and also "#pragma GCC visibility >> push(hidden)/#pragma GCC visibility pop" for block coverage in e.g. >> header files. Otherwise everything is visible by default. >> >> So I believe GNU can build a Windows dynamic or static library using the >> merged pthread.c after adding 'static' qualifiers where necessary, but I >> don't know off-hand if this works for MSVS. If it does, i.e. replace the >> need for _declspec(export/import), then we probably have a solution. I saw this the other day in a script that installs win32-pthreads: for file in 'pthread.h' 'sched.h' 'semaphore.h'; do ed -s "$prefix/include/$file" <<< $'g/ __declspec (dllexport)/s///g\nw\nq' ed -s "$prefix/include/$file" <<< $'g/ __declspec (dllimport)/s///g\nw\nq' done I'll admit that it is a bit frustrating to have to do export CFLAGS=-DPTW32_STATIC_LIB for anything that ends up using pthreads... FWIW. -roger-