Subject: Re: bug#2867: GNU Emacs 23.0.92 pretest fails to build for DJGPP target using SYSTEM_MALLOC
From: Eli Zaretskii <[email-masked]>
To: Rugxulo <[email-masked]>, [email-masked]
Date: Sat, 04 Apr 2009 12:44:56 +0300

> Date: Thu, 2 Apr 2009 16:09:45 -0400
> From: Rugxulo <[email-masked]>
> Cc: 
> 
> For 23 in CVS, Eli modified the CONFIG.BAT to support
> "--with-system-malloc", but there's a build error somewhere, even in
> the latest pretest download (23.0.92, I think it's called). Something
> about "_ret_lim_data":
> 
> msdos.o w16select.o xmenu.o    termcap.o tparam.o lastfile.o
> getloadavg.o
>                     -lg             -lm
> dosfns.o:dosfns.c:(.text+0x663): undefined reference to
> `_ret_lim_data'
> collect2: ld returned 1 exit status
> make.exe[1]: *** [temacs.exe] Error 1
> make.exe[1]: Leaving directory `c:/Armslurp/emacs-23.0.92/src'
> make.exe: *** [src] Error 2

Thanks for reporting this bug.  Fixed with the following change:

2009-04-04  Eli Zaretskii  <[email-masked]>

	* dosfns.c (system_process_attributes) [SYSTEM_MALLOC]: Don't call
	ret_lim_data.  (Bug#2867)

Index: src/dosfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dosfns.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- src/dosfns.c	3 Jan 2009 15:02:30 -0000	1.53
+++ src/dosfns.c	4 Apr 2009 09:42:12 -0000	1.54
@@ -571,7 +571,9 @@
       int i;
       Lisp_Object cmd_str, decoded_cmd, tem;
       double pmem;
+#ifndef SYSTEM_MALLOC
       extern unsigned long ret_lim_data ();
+#endif
 
       uid = getuid ();
       attrs = Fcons (Fcons (Qeuid, make_fixnum_or_float (uid)), attrs);
@@ -604,8 +606,12 @@
 			    make_fixnum_or_float ((unsigned long)sbrk(0)/1024)),
 		     attrs);
       attrs = Fcons (Fcons (Qetime, tem), attrs);
+#ifndef SYSTEM_MALLOC
+      /* ret_lim_data is on vm-limit.c, which is not compiled in under
+	 SYSTEM_MALLOC.  */
       pmem = (double)((unsigned long) sbrk (0)) / ret_lim_data () * 100.0;
       if (pmem > 100)
+#endif
 	pmem = 100;
       attrs = Fcons (Fcons (Qpmem, make_float (pmem)), attrs);
       /* Pass 1: Count how much storage we need.  */