From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#30176: readlinkat and _FORTIFY_SOURCE on Cygwin Date: Fri, 19 Jan 2018 15:46:39 -0500 Message-ID: <27a80447-e39b-0099-6063-1ab3517f668c@cornell.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1516394721 31438 195.159.176.226 (19 Jan 2018 20:45:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2018 20:45:21 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 Cc: Paul Eggert To: 30176@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 19 21:45:17 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecdXB-0007QQ-AX for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 21:45:09 +0100 Original-Received: from localhost ([::1]:44040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecdZB-0006bB-By for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 15:47:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecdZ5-0006at-Mi for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 15:47:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecdZ0-0000YD-PU for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 15:47:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecdZ0-0000Y3-L2 for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 15:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ecdYz-0005kX-W7; Fri, 19 Jan 2018 15:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: eggert@cs.ucla.edu, bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jan 2018 20:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30176 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Paul Eggert Original-Received: via spool by submit@debbugs.gnu.org id=B.151639481722088 (code B ref -1); Fri, 19 Jan 2018 20:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jan 2018 20:46:57 +0000 Original-Received: from localhost ([127.0.0.1]:35285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecdYu-0005kC-TH for submit@debbugs.gnu.org; Fri, 19 Jan 2018 15:46:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecdYu-0005jy-33 for submit@debbugs.gnu.org; Fri, 19 Jan 2018 15:46:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecdYn-0000J2-OK for submit@debbugs.gnu.org; Fri, 19 Jan 2018 15:46:50 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58295) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecdYn-0000Ik-LD for submit@debbugs.gnu.org; Fri, 19 Jan 2018 15:46:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecdYm-0006Wi-0t for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 15:46:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecdYh-0000F6-31 for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 15:46:48 -0500 Original-Received: from limerock02.mail.cornell.edu ([128.84.13.242]:43156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecdYg-0000Ep-U6 for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 15:46:43 -0500 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id w0JKkfRf003661 for ; Fri, 19 Jan 2018 15:46:41 -0500 Original-Received: from [10.13.22.4] (50-192-26-108-static.hfc.comcastbusiness.net [50.192.26.108]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id w0JKkdnp022669 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Fri, 19 Jan 2018 15:46:40 -0500 Content-Language: en-US X-PMX-Cornell-Gauge: Gauge=X X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142306 Archived-At: The next release of Cygwin (2.10.0), expected within the next few weeks, is going to have a new implementation of _FORTIFY_SOURCE guards for many functions, including readlinkat. The implementation is based on that of NetBSD and has the effect of adding code that looks essentially as follows after preprocessing: ssize_t __ssp_real_readlinkat (int __dirfd1, const char *__path, char *__buf, size_t __len) __asm__("readlinkat"); extern __inline__ __attribute__((__always_inline__, __gnu_inline__)) ssize_t readlinkat (int __dirfd1, const char *__path, char *__buf, size_t __len) __asm__("__ssp_protected_readlinkat"); extern __inline__ __attribute__((__always_inline__, __gnu_inline__)) ssize_t readlinkat (int __dirfd1, const char *__path, char *__buf, size_t __len) { if (__builtin_object_size(__buf, 2 > 1) != (size_t)-1 && __len > __builtin_object_size(__buf, 2 > 1)) __chk_fail(); return __ssp_real_readlinkat (__dirfd1, __path, __buf, __len); } The occurrence of this code in fileio.c, combined with the use of a pointer to readlinkat in the definition of emacs_readlinkat, leads to an "undefined reference to `__ssp_protected_readlinkat'" linking error. I'd appreciate some advice on how to fix this. I can think of three possibilities, but maybe there's something better: 1. Add "#define _FORTIFY_SOURCE 0' at the top of fileio.c (Cygwin only). 2. Pretend like Cygwin doesn't have readlinkat. Then gnulib will create its own definition, which will be found by the linker in libegnu.a. 3. Ask gnulib to come up with a fix. Thanks in advance for any advice. Ken