From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.bugs Subject: bug#6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca Date: Tue, 11 May 2010 11:57:17 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1273577201 28459 80.91.229.12 (11 May 2010 11:26:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 11 May 2010 11:26:41 +0000 (UTC) To: 6170@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 11 13:26:37 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnbh-00006Q-Ed for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 May 2010 13:26:37 +0200 Original-Received: from localhost ([127.0.0.1]:50133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBnbg-00029G-Fv for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 May 2010 07:26:36 -0400 Original-Received: from [140.186.70.92] (port=43627 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBnba-00025G-6m for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 07:26:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBnbY-0008IL-PV for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 07:26:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46671) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnbY-0008IH-NB for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 07:26:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OBnCv-0008GN-VU; Tue, 11 May 2010 07:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lawrence Mitchell Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 May 2010 11:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127357561631755 (code B ref -1); Tue, 11 May 2010 11:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 May 2010 11:00:16 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnCB-0008G8-NK for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:16 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnC9-0008G0-9N for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:14 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:38801) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OBnC3-0002SH-7h for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:07 -0400 Original-Received: from [140.186.70.92] (port=49740 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBnBz-0000sS-81 for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 07:00:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBnAz-0005kh-9o for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 06:59:02 -0400 Original-Received: from e450.epcc.ed.ac.uk ([129.215.56.230]:39061) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnAy-0005k3-Vk for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 06:59:01 -0400 Original-Received: from garnet.epcc.ed.ac.uk (garnet.epcc.ed.ac.uk [129.215.56.222]) by e450.epcc.ed.ac.uk (8.13.6/8.13.6) with ESMTP id o4BAwqvc006881 for ; Tue, 11 May 2010 11:58:52 +0100 (BST) Original-Received: from garnet.epcc.ed.ac.uk (localhost [127.0.0.1]) by garnet.epcc.ed.ac.uk (8.13.8+Sun/8.12.8) with ESMTP id o4BAvHdV012767 for ; Tue, 11 May 2010 11:57:17 +0100 (BST) Original-Received: (from lmitche4@localhost) by garnet.epcc.ed.ac.uk (8.13.8+Sun/8.13.8/Submit) id o4BAvHtK012764; Tue, 11 May 2010 11:57:17 +0100 (BST) X-Authentication-Warning: garnet.epcc.ed.ac.uk: lmitche4 set sender to lawrence.mitchell@ed.ac.uk using -f X-Edinburgh-Scanned: at mailhost.epcc.ed.ac.uk X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-detected-operating-system: by eggs.gnu.org: Solaris 8 (1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 11 May 2010 07:01:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36867 Archived-At: On this system, is provided by Sun and therefore doesn't define alloca, unlike on a typical GNU/linux system where contains the following: | #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC | # include | #endif /* Use GNU, BSD, or misc. */ When compiling emacs with gcc, alloca is therefore undefined. The culprit is this snippet in configure.in: | #ifndef __GNUC__ | # ifdef HAVE_ALLOCA_H | # include | # else /* AIX files deal with #pragma. */ | # ifndef alloca /* predefined by HP cc +Olibcalls */ | char *alloca (); | # endif | # endif /* HAVE_ALLOCA_H */ | #endif /* __GNUC__ */ On this system, configure correctly defines both HAVE_ALLOCA_H and HAVE_ALLOCA, but since the inclusion is guarded by __GNUC__ not being defined, we never include . I think the correct fix is to unconditionally define alloca if __GNUC__ is detected, see patch below. Note that this is closer to how autoconf checks for the presence of the alloca function. Possible changelog entry: 2010-05-11 Lawrence Mitchell * configure.in: Unconditionally define alloca if __GNUC__ is detected. diff --git a/configure.in b/configure.in index 8a7d9be..98b6abb 100644 --- a/configure.in +++ b/configure.in @@ -3360,6 +3360,9 @@ extern char *getenv (); char *alloca (); # endif # endif /* HAVE_ALLOCA_H */ +#else +# undef alloca +# define alloca __builtin_alloca #endif /* __GNUC__ */ #ifndef HAVE_SIZE_T typedef unsigned size_t;