aboutsummaryrefslogtreecommitdiffstats
path: root/community/emacs/musl.patch
blob: 7841d04e7697a5d41baef3c5d0451df1baf20123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--- emacs-25.1/configure.ac	2016-07-25 07:08:36.000000000 +0000
+++ emacs-25.1-musl/configure.ac	2016-10-24 15:38:00.518625055 +0000
@@ -2133,7 +2133,7 @@
 
 system_malloc=$emacs_cv_sanitize_address
 
-hybrid_malloc=
+hybrid_malloc=yes
 
 case "$opsys" in
   ## darwin ld insists on the use of malloc routines in the System framework.
--- emacs-25.1/src/Makefile.in	2016-06-29 09:49:20.000000000 +0000
+++ emacs-25.1-musl/src/Makefile.in	2016-10-24 15:38:00.518625055 +0000
@@ -398,6 +398,7 @@
 	doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
 	$(XWIDGETS_OBJ) \
 	profiler.o decompress.o \
+	sheap.o \
 	$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
 	$(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
 obj = $(base_obj) $(NS_OBJC_OBJ)
--- emacs-25.1/src/gmalloc.c	2016-06-29 09:49:22.000000000 +0000
+++ emacs-25.1-musl/src/gmalloc.c	2016-10-24 15:38:00.518625055 +0000
@@ -70,7 +70,7 @@
 #define aligned_alloc galigned_alloc
 #define free gfree
 
-#ifdef CYGWIN
+//#ifdef CYGWIN
 extern void *bss_sbrk (ptrdiff_t size);
 extern int bss_sbrk_did_unexec;
 extern char bss_sbrk_buffer[];
@@ -78,7 +78,7 @@
 #define DUMPED bss_sbrk_did_unexec
 #define ALLOCATED_BEFORE_DUMPING(P) \
   ((P) < bss_sbrk_buffer_end && (P) >= (void *) bss_sbrk_buffer)
-#endif
+//#endif
 
 #ifdef	__cplusplus
 extern "C"
@@ -1523,16 +1523,19 @@
 __default_morecore (ptrdiff_t increment)
 {
   void *result;
-#if defined (CYGWIN)
+//#if defined (CYGWIN)
   if (!DUMPED)
     {
       return bss_sbrk (increment);
     }
-#endif
+//#endif
+#if 0
   result = (void *) __sbrk (increment);
   if (result == (void *) -1)
     return NULL;
   return result;
+#endif
+  return NULL;
 }
 /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 
--- emacs-25.1/src/print.c	2016-06-29 09:49:22.000000000 +0000
+++ emacs-25.1-musl/src/print.c	2016-10-24 15:38:00.518625055 +0000
@@ -775,7 +775,7 @@
   print_output_debug_flag = x;
 }
 
-#if defined (GNU_LINUX)
+#if defined (GNU_LINUX) && defined (__GLIBC__)
 
 /* This functionality is not vitally important in general, so we rely on
    non-portable ability to use stderr as lvalue.  */
--- emacs-25.1/src/unexelf.c	2016-06-29 09:49:23.000000000 +0000
+++ emacs-25.1-musl/src/unexelf.c	2016-10-24 15:38:00.518625055 +0000
@@ -227,6 +227,9 @@
   off_t new_file_size;
   void *new_break;
 
+  extern int bss_sbrk_did_unexec;
+  bss_sbrk_did_unexec = 1;
+
   /* Pointers to the base of the image of the two files.  */
   caddr_t old_base, new_base;