From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#37852: Build failure on MSYS2 (undefined reference to _chk functions) Date: Mon, 21 Oct 2019 17:40:12 -0700 Organization: UCLA Computer Science Department Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------7395C89D8EC09883C8C030CC" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="45196"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 Cc: Richard Copley , 37852@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 22 02:41:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMiEa-000Bf0-RB for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Oct 2019 02:41:12 +0200 Original-Received: from localhost ([::1]:49064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMiEZ-0000f6-O2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 20:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34443) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMiET-0000ey-Pr for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 20:41:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMiES-0005hF-Dr for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 20:41:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMiES-0005h9-AQ for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 20:41:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMiEQ-0001zA-Cm for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 20:41:04 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Oct 2019 00:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37852 X-GNU-PR-Package: emacs Original-Received: via spool by 37852-submit@debbugs.gnu.org id=B37852.15717048247578 (code B ref 37852); Tue, 22 Oct 2019 00:41:02 +0000 Original-Received: (at 37852) by debbugs.gnu.org; 22 Oct 2019 00:40:24 +0000 Original-Received: from localhost ([127.0.0.1]:58060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMiDo-0001y8-E4 for submit@debbugs.gnu.org; Mon, 21 Oct 2019 20:40:24 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:56092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMiDk-0001xr-TN for 37852@debbugs.gnu.org; Mon, 21 Oct 2019 20:40:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 21A54160619; Mon, 21 Oct 2019 17:40:15 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nwQx0bfqJZRT; Mon, 21 Oct 2019 17:40:12 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 55467160635; Mon, 21 Oct 2019 17:40:12 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TG6fSWRhlL1T; Mon, 21 Oct 2019 17:40:12 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 36104160619; Mon, 21 Oct 2019 17:40:12 -0700 (PDT) Content-Language: en-US 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: 209.51.188.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:169960 Archived-At: This is a multi-part message in MIME format. --------------7395C89D8EC09883C8C030CC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > I think we should better disable GNULIB_PORTCHECK on MinGW (I can hardly > imagine someone using that platform for those portability checks, and > I'm not sure I understand why this gets defined by default on other > platforms). The intent of GNULIB_PORTCHECK is that it is enabled by developers who want some simple build-time portability tests. It isn't suitable for people who just want to build the software, as there are too many build failures and other false alarms that builders don't care about. I installed the attached patch, to cause the problem to occur only if one configures explicitly with --enable-gcc-warnings. This should fix the problem that Richard reported. However, it won't fix the more general problem (which Richard should be able to reproduce via './configure --enable-gcc-warnings ...'). Apparently MSYS2 changed recently, and this caused _FORTIFY_SOURCE builds to fail. See, for example: https://github.com/msys2/MINGW-packages/issues/5803 I don't understand MSYS2 well enough to suggest fixes for Emacs, other than "don't configure with --enable-gcc-warnings and don't compile with _FORTIFY_SOURCE defined". --------------7395C89D8EC09883C8C030CC Content-Type: text/x-patch; charset=UTF-8; name="0001-Portcheck-only-if-enable-gcc-warnings.patch" Content-Disposition: attachment; filename="0001-Portcheck-only-if-enable-gcc-warnings.patch" Content-Transfer-Encoding: quoted-printable >From 0ccd70a99b5cbd3cf7fea65c47a724846c578a43 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 21 Oct 2019 17:28:02 -0700 Subject: [PATCH] Portcheck only if --enable-gcc-warnings MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Problem reported by Richard Copley (Bug#37852). This patch causes the problem to not occur if one uses plain =E2=80=98configure=E2=80=99. The problem can still occur if with =E2=80=98= configure --enable-gcc-warnings=E2=80=99, so a further fix may be needed. * configure.ac (GNULIB_PORTCHECK, _FORTIFY_SOURCE): Define these only with an explicit --enable-gcc-warnings. --- configure.ac | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 33d725c804..3b6a2a6d16 100644 --- a/configure.ac +++ b/configure.ac @@ -1114,15 +1114,16 @@ AC_DEFUN fi =20 AC_DEFINE([GCC_LINT], [1], [Define to 1 if --enable-gcc-warnings.]) - AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability che= cks]) - AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE], - [/* Enable compile-time and run-time bounds-checking, and some warning= s, - without upsetting glibc 2.15+. */ - #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \ - && defined __OPTIMIZE__ && __OPTIMIZE__) - # define _FORTIFY_SOURCE 2 - #endif - ]) + AS_IF([test $gl_gcc_warnings =3D yes], + [AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability = checks]) + AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE], + [/* Enable compile-time and run-time bounds-checking, and some warn= ings, + without upsetting glibc 2.15+. */ + #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \ + && defined __OPTIMIZE__ && __OPTIMIZE__) + # define _FORTIFY_SOURCE 2 + #endif + ])]) ]) =20 # clang is picky about these regardless of whether --=20 2.21.0 --------------7395C89D8EC09883C8C030CC--