From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: hybrid_malloc on CANNOT_DUMP? Date: Sun, 20 Nov 2016 20:58:43 -0800 Organization: UCLA Computer Science Department Message-ID: References: <337f0a16-afbb-63dc-0d24-d53a9986be31@dancol.org> <92f6cd2e-5141-6e60-df08-4a33269928cd@cs.ucla.edu> <4FCCE846-4073-407B-B9D7-C8A0032DD2FE@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------245632FB5431ED206DD09058" X-Trace: blaine.gmane.org 1479704595 19689 195.159.176.226 (21 Nov 2016 05:03:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2016 05:03:15 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 Cc: Daniel Colascione , Emacs developers To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 21 06:03:09 2016 Return-path: Envelope-to: ged-emacs-devel@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 1c8gl1-0003Fx-Vw for ged-emacs-devel@m.gmane.org; Mon, 21 Nov 2016 06:03:08 +0100 Original-Received: from localhost ([::1]:47405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8gl2-0000w4-Bd for ged-emacs-devel@m.gmane.org; Mon, 21 Nov 2016 00:03:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8ggu-0005yw-Bf for emacs-devel@gnu.org; Sun, 20 Nov 2016 23:58:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8ggp-0001lt-HA for emacs-devel@gnu.org; Sun, 20 Nov 2016 23:58:52 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:52072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c8ggp-0001lT-8Z for emacs-devel@gnu.org; Sun, 20 Nov 2016 23:58:47 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E07D916009D; Sun, 20 Nov 2016 20:58:45 -0800 (PST) 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 3RDjDCyKgrYo; Sun, 20 Nov 2016 20:58:43 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AEF321600A2; Sun, 20 Nov 2016 20:58:43 -0800 (PST) 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 ODUG3XA8hMnY; Sun, 20 Nov 2016 20:58:43 -0800 (PST) Original-Received: from [192.168.1.9] (unknown [47.153.178.162]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 7840216009D; Sun, 20 Nov 2016 20:58:43 -0800 (PST) In-Reply-To: <4FCCE846-4073-407B-B9D7-C8A0032DD2FE@raeburn.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209519 Archived-At: This is a multi-part message in MIME format. --------------245632FB5431ED206DD09058 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Ken Raeburn wrote: > my_endbss is no longer defined if CANNOT_DUMP is true, but emacs.c refe= rences it if GNU_LINUX is defined. Thanks, I suspect I didn't see that because my GCC optimized away all use= s of=20 my_endbss etc. before the linker could see them. I installed the attached= to try=20 to port to less-industrious compilers. --------------245632FB5431ED206DD09058 Content-Type: text/x-diff; name="0001-Fix-undefined-refs-on-some-GNU-Linux-hosts.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Fix-undefined-refs-on-some-GNU-Linux-hosts.patch" =46rom 33b69e2d76e514b0cce39b1e516fb8ffe2cfd497 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 20 Nov 2016 20:55:35 -0800 Subject: [PATCH] Fix undefined refs on some GNU/Linux hosts Problem reported by Ken Raeburn in: http://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00463.html * src/emacs.c (heap_bss_diff) [CANNOT_DUMP]: Remove, as this is not needed in the CANNOT_UNDUMP case. All uses removed. This removes unwanted references to my_endbss and my_endbss_static, which are not optimized away on some platforms. --- src/emacs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emacs.c b/src/emacs.c index ac9b649..48df533 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -161,7 +161,7 @@ bool display_arg; Tells GC how to save a copy of the stack. */ char *stack_bottom; =20 -#ifdef GNU_LINUX +#if defined GNU_LINUX && !defined CANNOT_DUMP /* The gap between BSS end and heap start as far as we can tell. */ static uprintmax_t heap_bss_diff; #endif @@ -716,14 +716,14 @@ main (int argc, char **argv) =20 #ifndef CANNOT_DUMP might_dump =3D !initialized; -#endif =20 -#ifdef GNU_LINUX +# ifdef GNU_LINUX if (!initialized) { char *heap_start =3D my_heap_start (); heap_bss_diff =3D heap_start - max (my_endbss, my_endbss_static); } +# endif #endif =20 #if defined WINDOWSNT || defined HAVE_NTGUI @@ -2126,7 +2126,7 @@ You must run Emacs in batch mode in order to dump i= t. */) if (!might_dump) error ("Emacs can be dumped only once"); =20 -#ifdef GNU_LINUX +#if defined GNU_LINUX && !defined CANNOT_DUMP =20 /* Warn if the gap between BSS end and heap start is larger than this.= */ # define MAX_HEAP_BSS_DIFF (1024*1024) --=20 2.7.4 --------------245632FB5431ED206DD09058--