From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42775 invoked by alias); 13 Sep 2019 22:08:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 42765 invoked by uid 89); 13 Sep 2019 22:08:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=H*UA:Firefox, HContent-Transfer-Encoding:8bit X-HELO: m0.truegem.net Received: from m0.truegem.net (HELO m0.truegem.net) (69.55.228.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Sep 2019 22:08:23 +0000 Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id x8DM8LgK019233 for ; Fri, 13 Sep 2019 15:08:21 -0700 (PDT) (envelope-from mark@maxrnd.com) Received: from 162-235-43-67.lightspeed.irvnca.sbcglobal.net(162.235.43.67), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdx4T8pF; Fri Sep 13 15:08:20 2019 Subject: Re: [ANNOUNCEMENT] cygwin 3.1.0-0.4 (TEST) To: cygwin@cygwin.com References: <855a9543-6908-42f0-576a-0f161777f715@ssi-schaefer.com> From: Mark Geisert Message-ID: Date: Fri, 13 Sep 2019 22:14:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: <855a9543-6908-42f0-576a-0f161777f715@ssi-schaefer.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2019-09/txt/msg00168.txt.bz2 Michael Haubenwallner wrote: > On 9/5/19 3:16 PM, Ken Brown wrote: >> The following packages have been uploaded to the Cygwin distribution >> as test releases: >> >> * cygwin-3.1.0-0.4 >> * cygwin-devel-3.1.0-0.4 >> * cygwin-doc-3.1.0-0.4 > >> - New APIs: sched_getaffinity, sched_setaffinity, pthread_getaffinity_np, >> pthread_setaffinity_np, plus CPU_SET macros. > > There's some problem with , seen with boost-1.71.0/bootstrap.sh, > even after tweaking their sysinfo.cpp like this to include : > > -#if defined(OS_LINUX) > +#if defined(OS_LINUX) || defined(OS_CYGWIN) > > This boils down to a test case like this that succeeds to *compile* on Linux, > although requires _GNU_SOURCE to be defined earlier to perform anything useful: > > $ cat > test.cc <<'EOF' > #ifdef LIKE_BOOST > # include > # define _GNU_SOURCE > #endif > #include > int main() > { > #if defined(CPU_COUNT_S) > ::cpu_set_t cpu_set; > if (::sched_getaffinity(0, sizeof(cpu_set_t), &cpu_set) == 0) > { > return CPU_COUNT_S(sizeof(cpu_set_t), &cpu_set); > } > #endif > return 0; > } > EOF > > Both these commands fail to compile on Cygwin with identical error: > $ g++ test.c -DLIKE_BOOST > $ g++ test.c > test.c: In function ‘main’: > test.c:10:7: warning: implicit declaration of function ‘sched_getaffinity’; did you mean ‘sched_getparam’? [-Wimplicit-function-declaration] > if (sched_getaffinity(0, sizeof(cpu_set_t), &cpu_set) == 0) > ^~~~~~~~~~~~~~~~~ > sched_getparam > > Actually it is boost's fault to include before defining _GNU_SOURCE, > but it feels like Cygwin should *not* define CPU_COUNT_S without _GNU_SOURCE. > > Thoughts? > /haubi/ > > PS: This does work as expected: > $ g++ test.c -D_GNU_SOURCE Thanks for the problem report. Blame me for this one. I believe your last suggestion is the correct fix but I want to double-check something additional. Shortly I'll submit a patch to correct this one way or another. ..mark -- 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