* undefined reference to `my_heap_start'
@ 2019-01-16 10:07 Colin Baxter
2019-01-17 1:36 ` Paul Eggert
0 siblings, 1 reply; 3+ messages in thread
From: Colin Baxter @ 2019-01-16 10:07 UTC (permalink / raw)
To: emacs-devel
Hello,
I'm getting a make error on today's pull of emacs:
make[2]: Entering directory '/home/redknight/git/emacs/admin/unidata'
GEN ../../lisp/international/charscript.el
make[2]: Leaving directory '/home/redknight/git/emacs/admin/unidata'
CCLD temacs.in
alloc.o: In function `malloc_initialize_hook':
/home/redknight/git/emacs/src/alloc.c:140: undefined reference to `my_heap_start'
collect2: error: ld returned 1 exit status
Makefile:634: recipe for target 'temacs.in' failed
make[1]: *** [temacs.in] Error 1
make[1]: Leaving directory '/home/redknight/git/emacs/src'
Makefile:423: recipe for target 'src' failed
make: *** [src] Error 2
I'm on 3.16.0-7-686-pae #1 SMP Debian 3.16.59-1 (2018-10-03) i686
GNU/Linux.
Best wishes,
--
Colin Baxter
m43cap@yandex.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: undefined reference to `my_heap_start'
2019-01-16 10:07 undefined reference to `my_heap_start' Colin Baxter
@ 2019-01-17 1:36 ` Paul Eggert
2019-01-17 6:38 ` Colin Baxter
0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2019-01-17 1:36 UTC (permalink / raw)
To: Colin Baxter; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
On 1/16/19 2:07 AM, Colin Baxter wrote:
> CCLD temacs.in
> alloc.o: In function `malloc_initialize_hook':
> /home/redknight/git/emacs/src/alloc.c:140: undefined reference to `my_heap_start'
I think I see the problem. I installed the attached patch; please give
it a try.
[-- Attachment #2: 0001-Port-pdumper-to-older-GNU-Linux.patch --]
[-- Type: text/x-patch, Size: 1887 bytes --]
From 696d43275eaa12982e28ec3b080441d6ca9dec34 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 16 Jan 2019 17:34:45 -0800
Subject: [PATCH] Port pdumper to older GNU/Linux
Problem reported by Colin Baxter in:
https://lists.gnu.org/r/emacs-devel/2019-01/msg00321.html
* src/alloc.c (my_heap_start): Also define if
GNU_LINUX && CANNOT_DUMP && DOUG_LEA_MALLOC.
---
src/alloc.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/alloc.c b/src/alloc.c
index 8054aa5ae5..5ea466beca 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -103,24 +103,12 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "w32heap.h" /* for sbrk */
#endif
-#if defined GNU_LINUX && !defined CANNOT_DUMP
-/* The address where the heap starts. */
-void *
-my_heap_start (void)
-{
- static void *start;
- if (! start)
- start = sbrk (0);
- return start;
-}
-#endif
-
#ifdef DOUG_LEA_MALLOC
/* Specify maximum number of areas to mmap. It would be nice to use a
value that explicitly means "no limit". */
-#define MMAP_MAX_AREAS 100000000
+# define MMAP_MAX_AREAS 100000000
/* A pointer to the memory allocated that copies that static data
inside glibc's malloc. */
@@ -136,9 +124,9 @@ malloc_initialize_hook (void)
if (! initialized)
{
-#ifdef GNU_LINUX
+# ifdef GNU_LINUX
my_heap_start ();
-#endif
+# endif
malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
}
else
@@ -201,6 +189,20 @@ alloc_unexec_post (void)
free (malloc_state_ptr);
# endif
}
+
+# ifdef GNU_LINUX
+
+/* The address where the heap starts. */
+void *
+my_heap_start (void)
+{
+ static void *start;
+ if (! start)
+ start = sbrk (0);
+ return start;
+}
+# endif
+
#endif
/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: undefined reference to `my_heap_start'
2019-01-17 1:36 ` Paul Eggert
@ 2019-01-17 6:38 ` Colin Baxter
0 siblings, 0 replies; 3+ messages in thread
From: Colin Baxter @ 2019-01-17 6:38 UTC (permalink / raw)
To: Paul Eggert; +Cc: emacs-devel
Dear Paul,
>>>>> Paul Eggert <eggert@cs.ucla.edu> writes:
Paul> On 1/16/19 2:07 AM, Colin Baxter wrote:
>> CCLD temacs.in alloc.o: In function `malloc_initialize_hook':
>> /home/redknight/git/emacs/src/alloc.c:140: undefined reference to
>> `my_heap_start'
Paul> I think I see the problem. I installed the attached patch;
Paul> please give it a try.
That seems to work. I can now make GNU Emacs 27.0.50 (build 1,
i686-pc-linux-gnu, GTK+ Version 3.14.5) of 2019-01-17.
Thank you.
--
Colin Baxter
m43cap@yandex.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-17 6:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 10:07 undefined reference to `my_heap_start' Colin Baxter
2019-01-17 1:36 ` Paul Eggert
2019-01-17 6:38 ` Colin Baxter
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).