all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Rich Felker <dalias@libc.org>
Cc: emacs-devel@gnu.org
Subject: Re: Dumper problems and a possible solutions
Date: Tue, 24 Jun 2014 15:27:39 -0400	[thread overview]
Message-ID: <jwv4mzaxgk2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20140624171955.GS179@brightrain.aerifal.cx> (Rich Felker's message of "Tue, 24 Jun 2014 13:19:55 -0400")

> To solve ALL of the problems with the dumper (which seems to be a
> recurring theme), I have a proposed design to make it fully portable
> -- even moreso than xemacs "portable dumper" which is still an ugly
> hack. The idea is simple: after loading all of the lisp objects that
> need dumping, walk the lisp heap and output a representation for each
> object as a giant static array in C source format, then compile and
> link this new translation unit with the rest of the emacs .o files to
> produce a final emacs binary. No hacks with binary formats would be
> involved; everything would happen at the C source level. As part of
> the lisp heap dumping, address references to other objects would have
> to be relocated to refer to the object's position in the static array
> rather than the original address at which the object resided when
> created in temacs. That's some non-trivial work, but definitely no
> prohibitive, and as a bonus, the generated address-constant references
> in the static array would transform to load-address-relative
> relocations for the linker, allowing emacs to be built as a
> position-indepdendent executable (PIE) if desired.

Generating a big static C array against which to link sounds fine and
very portable, indeed.  I'm not sure how hard/easy the relocation could
turn out to be.  There's the problem of finding *all* the references,
and there's the problem that moving an object means that its "hash"
value changes.

> If not, or if that's going to be a very long-term project, would a
> cleaned-up version of my current solution be acceptable upstream?

Making the "dump" portable would be very welcome.  Generating a big
static C array sounds OK.  So whether the result is acceptable or not
will depend on what's needed to solve the problems linked to relocation.

Another option is to "dump" the heap into a binary file that we would
later on "mmap".


        Stefan



  reply	other threads:[~2014-06-24 19:27 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 17:19 Dumper problems and a possible solutions Rich Felker
2014-06-24 19:27 ` Stefan Monnier [this message]
2014-06-24 19:40   ` Rich Felker
2014-06-24 20:24     ` Stefan Monnier
2014-06-24 21:15       ` Rich Felker
2014-06-24 21:37         ` Stefan Monnier
2014-06-25 18:03 ` Dmitry Antipov
2014-06-25 18:08   ` Rich Felker
2014-06-25 18:30     ` Dmitry Antipov
2014-06-25 18:36       ` Rich Felker
2014-06-25 18:36       ` Eli Zaretskii
2014-06-25 18:41     ` Eli Zaretskii
2014-06-26  0:16     ` Stephen J. Turnbull
2014-06-25 18:20   ` Eli Zaretskii
2014-06-25 18:32     ` Rich Felker
2014-06-25 18:49       ` Eli Zaretskii
2014-06-25 19:03         ` Rich Felker
2014-06-25 19:18           ` Eli Zaretskii
2014-06-25 19:57             ` Rich Felker
2014-06-25 20:15               ` Eli Zaretskii
2014-06-25 20:34                 ` Rich Felker
2014-06-26  2:44                   ` Eli Zaretskii
2014-06-26  4:28                     ` Rich Felker
2014-06-26 15:02                       ` Eli Zaretskii
2014-06-25 20:11             ` Stefan Monnier
2014-06-25 20:06           ` Stefan Monnier
2014-06-25 20:24             ` Rich Felker
2014-06-25 21:43               ` Stefan Monnier
2014-06-25 22:07                 ` Rich Felker
2014-06-25 23:04                   ` Paul Eggert
2014-06-25 23:21                     ` Rich Felker
2014-06-25 23:05                   ` Stefan Monnier
2014-06-25 23:19                     ` Rich Felker
2014-06-26  3:02                   ` Dmitry Antipov
2014-06-26  4:14                     ` Rich Felker
2014-06-26  4:32                       ` Dmitry Antipov
2014-06-26 11:49                         ` Rich Felker
2014-06-26 15:03                         ` Eli Zaretskii
2014-06-26 15:10                           ` Rich Felker
2014-06-25 22:33               ` Andreas Schwab
2014-06-25 20:53       ` Samuel Bronson
2014-06-25 21:24         ` Rich Felker
2014-06-25 18:38   ` Stefan Monnier

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=jwv4mzaxgk2.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dalias@libc.org \
    --cc=emacs-devel@gnu.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.