emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix for Cygwin/GSlice problem


From: Ken Brown
Subject: Re: Fix for Cygwin/GSlice problem
Date: Wed, 09 Dec 2009 11:30:16 -0500
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

On 12/9/2009 10:00 AM, Ken Brown wrote:
On 12/9/2009 9:31 AM, Stefan Monnier wrote:
+/* Emacs supplies its own malloc, but glib (part of Gtk+) calls
+ memalign and on Cygwin, that becomes the Cygwin supplied memalign.
+ As malloc is not the Cygwin malloc, the Cygwin memalign always
+ returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */
+#define G_SLICE_ALWAYS_MALLOC
Why does Cygwin-Emacs use its own malloc rather than the system malloc?
Emacs prefers its own malloc when the system malloc doesn't have the
required hooks.  If this is critical or not I don't know.

I'd suggest we try to use Cygwin's system malloc, with a clear comment
about why we don't use our own, and what kind of workaround could be
used (the G_SLICE_ALWAYS_MALLOC) if we wanted to use our own.

OK, I'll give it a try and report back. I assume the way to do this is to remove '#define G_SLICE_ALWAYS_MALLOC' from src/s/cygwin.h and instead #define SYSTEM_MALLOC. [You don't need to respond unless this is wrong.]

I tried this, and the build fails with

gcc -o temacs ecrt0.o dispnew.o frame.o scroll.o xdisp.o menu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o cm.o term.o terminal.o xfaces.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexcw.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o sheap.o terminfo.o lastfile.o vm-limit.o getloadavg.o -lcurses -lg `gcc -print-libgcc-file-name` -lm -lc `gcc -print-libgcc-file-name` vm-limit.o:vm-limit.c:(.text+0x17): undefined reference to `___after_morecore_hook'
vm-limit.o:vm-limit.c:(.text+0x6c): undefined reference to `___morecore'

I looked at the source code, and I can't see any place where Cygwin's malloc.h is getting included. I don't know if that's the (only) problem.

I also asked for help on the Cygwin list and got the following two responses:

...cygwin doesn't provide something
that linux does.  It's possible that you may be able to work around
the problem by using a -D__morecore=sbrk (or maybe one more underscore
is needed) on the compile line for vm-limit.c.

why are you bothering to specify the system libs at all?  You're using
the gcc driver to link, it'll do all that for you automatically (and
correctly) if you just leave them out; you shouldn't need anything but
-lcurses out of that lot.  You'll definitely break linking against the shared
libgcc by putting the static archive in the list of user libraries like that.

I'm really in over my head at this point. If someone sees something I can do to fix this, I'll give it a try. Otherwise, maybe we should just stick with the G_SLICE workaround for now.

Ken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]