From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (static.214.254.202.116.clients.your-server.de [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 6E1673857809 for ; Sun, 30 Aug 2020 19:21:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6E1673857809 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kCStb-0005Sx-1b for cygwin@cygwin.com; Sun, 30 Aug 2020 21:21:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin@cygwin.com From: Subject: Re: cpp /usr/include/threads.h fails; modfl segfaults Date: Sun, 30 Aug 2020 15:21:35 -0400 Message-ID: References: <02b16d2e-9d51-de58-807b-3b31b2565b59.ref@aol.com> <02b16d2e-9d51-de58-807b-3b31b2565b59@aol.com> <20200830130005.GR3272@calimero.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (cygwin) Cancel-Lock: sha1:TA8uuObsezx/x69/1MgajkenXfc= X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_GOODAOL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Aug 2020 19:22:03 -0000 Corinna Vinschen writes: > On Aug 29 08:52, airplanemath via Cygwin wrote: >> Hello, >> >> I have two reports. A brief description of the system: >> $ uname -a | sed "s/${HOSTNAME}/\${HOSTNAME}/g" >> CYGWIN_NT-10.0 ${HOSTNAME} 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin >> >> The first report: >> >> $ cpp /usr/include/threads.h >> # 1 "/usr/include/threads.h" >> # 1 "" >> # 1 "" >> # 1 "/usr/include/threads.h" >> /usr/include/threads.h:30:10: fatal error: machine/_threads.h: No such >> file or directory >> 30 | #include >> | ^~~~~~~~~~~~~~~~~~~~ >> compilation terminated. > > The reason for this is, as Ken already pointed out, that > machine/_threads.h only existed for RTEMS, not for any other target > supported by newlib. Worse, Cygwin never got around to implement the > C11 threads functions yet. > > I added these functions as wrappers around pthread functionality, code > taken from FreeBSD. I ran the glibc testsuite on them, and after fixing > the bugs in the glibc testsuite (d'oh), the tests ran successfully. > The header makes it through the preprocessor for me now. Thank you. >> $ cat test.c >> #include >> #include >> #include >> >> int main(int argc, char *argv[]) { >> long double a, b, c; >> char *num_end = NULL; >> a = b = c = 0.0L; >> if (argc != 2) { >> fprintf(stderr, "Usage: %s NUMBER\n", argv[0]); >> exit(1); >> } >> a = strtold(argv[1], &num_end); >> b = modfl(a, &c); >> printf("%Lf %Lf %Lf\n", a, b, c); >> return 0; >> } > > This is a bug in the assembler code taken from Mingw-w64. The bug has > been fixed upstream, so I just pulled in the upstream fixes. The test program now finishes without segfaulting, and gives the expected answer. Thanks again. > > Thus, both of the above problems should be fixed now. I created a > developer snapshot and uploaed it to https://cygwin.com/snapshots/ You > need to grab the full tar file and install at least the following files > to your installation after backing up the original files from 3.1.7: > > usr/bin/cygwin1.dll (this is pre-release 3.2.0) > usr/lib/libcygwin.a > usr/include/limits.h > usr/include/pthread.h > usr/include/machine/_threads.h > Is it okay to leave these in place to be overwritten by 3.2.0, or should I move the old versions back? > Thanks for the report. > Thanks for the prompt response. > > Corinna