all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Ken Raeburn <raeburn@raeburn.org>
Cc: Daniel Colascione <dancol@dancol.org>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: hybrid_malloc on CANNOT_DUMP?
Date: Sun, 20 Nov 2016 20:58:43 -0800	[thread overview]
Message-ID: <b9c766e5-ad33-567f-b8bf-ace2e6f71f83@cs.ucla.edu> (raw)
In-Reply-To: <4FCCE846-4073-407B-B9D7-C8A0032DD2FE@raeburn.org>

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Ken Raeburn wrote:
> my_endbss is no longer defined if CANNOT_DUMP is true, but emacs.c references it if GNU_LINUX is defined.

Thanks, I suspect I didn't see that because my GCC optimized away all uses of 
my_endbss etc. before the linker could see them. I installed the attached to try 
to port to less-industrious compilers.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-undefined-refs-on-some-GNU-Linux-hosts.patch --]
[-- Type: text/x-diff; name="0001-Fix-undefined-refs-on-some-GNU-Linux-hosts.patch", Size: 1792 bytes --]

From 33b69e2d76e514b0cce39b1e516fb8ffe2cfd497 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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;
 
-#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)
 
 #ifndef CANNOT_DUMP
   might_dump = !initialized;
-#endif
 
-#ifdef GNU_LINUX
+# ifdef GNU_LINUX
   if (!initialized)
     {
       char *heap_start = my_heap_start ();
       heap_bss_diff = heap_start - max (my_endbss, my_endbss_static);
     }
+# endif
 #endif
 
 #if defined WINDOWSNT || defined HAVE_NTGUI
@@ -2126,7 +2126,7 @@ You must run Emacs in batch mode in order to dump it.  */)
   if (!might_dump)
     error ("Emacs can be dumped only once");
 
-#ifdef GNU_LINUX
+#if defined GNU_LINUX && !defined CANNOT_DUMP
 
   /* Warn if the gap between BSS end and heap start is larger than this.  */
 # define MAX_HEAP_BSS_DIFF (1024*1024)
-- 
2.7.4


  reply	other threads:[~2016-11-21  4:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-20 17:16 hybrid_malloc on CANNOT_DUMP? Daniel Colascione
2016-11-20 17:34 ` Eli Zaretskii
2016-11-21  1:03 ` Paul Eggert
2016-11-21  3:05   ` Ken Raeburn
2016-11-21  4:58     ` Paul Eggert [this message]
2016-11-21  6:10       ` Ken Raeburn
2016-11-21 11:41   ` Robert Pluim
2016-11-21 16:43     ` Paul Eggert
2016-11-21 16:55       ` Robert Pluim
2016-11-21 23:15         ` Daniel Colascione

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b9c766e5-ad33-567f-b8bf-ace2e6f71f83@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=raeburn@raeburn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.