Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 221281 | Differences between
and this patch

Collapse All | Expand All

(-)emacs-21.4-orig/configure.in (+12 lines)
Lines 1358-1363 Link Here
1358
AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1358
AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1359
  linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1359
  linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1360
  termcap.h stdio_ext.h fcntl.h term.h strings.h)
1360
  termcap.h stdio_ext.h fcntl.h term.h strings.h)
1361
1362
AC_MSG_CHECKING(if personality LINUX32 can be set)
1363
AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
1364
	       emacs_cv_personality_linux32=yes,
1365
	       emacs_cv_personality_linux32=no)
1366
AC_MSG_RESULT($emacs_cv_personality_linux32)
1367
1368
if test $emacs_cv_personality_linux32 = yes; then
1369
  AC_DEFINE(HAVE_PERSONALITY_LINUX32, 1,
1370
	    [Define to 1 if personality LINUX32 can be set.])
1371
fi
1372
1361
AC_HEADER_STDC
1373
AC_HEADER_STDC
1362
AC_HEADER_TIME
1374
AC_HEADER_TIME
1363
AC_DECL_SYS_SIGLIST
1375
AC_DECL_SYS_SIGLIST
(-)emacs-21.4-orig/src/config.in (+1 lines)
Lines 183-188 Link Here
183
#undef HAVE_UALARM
183
#undef HAVE_UALARM
184
#undef HAVE_SYS_WAIT_H
184
#undef HAVE_SYS_WAIT_H
185
#undef HAVE_STRINGS_H
185
#undef HAVE_STRINGS_H
186
#undef HAVE_PERSONALITY_LINUX32
186
187
187
#undef HAVE_LIBDNET
188
#undef HAVE_LIBDNET
188
#undef HAVE_LIBPTHREADS
189
#undef HAVE_LIBPTHREADS
(-)emacs-21.4-orig/src/emacs.c (-1 / +58 lines)
Lines 61-66 Link Here
61
#include <sys/resource.h>
61
#include <sys/resource.h>
62
#endif
62
#endif
63
63
64
#ifdef HAVE_PERSONALITY_LINUX32
65
#include <sys/personality.h>
66
#endif
67
64
#ifndef O_RDWR
68
#ifndef O_RDWR
65
#define O_RDWR 2
69
#define O_RDWR 2
66
#endif
70
#endif
Lines 181-186 Link Here
181
   Tells GC how to save a copy of the stack.  */
185
   Tells GC how to save a copy of the stack.  */
182
char *stack_bottom;
186
char *stack_bottom;
183
187
188
/* The address where the heap starts (from the first sbrk (0) call).  */
189
static void *my_heap_start;
190
191
/* The gap between BSS end and heap start as far as we can tell.  */
192
static unsigned long heap_bss_diff;
193
194
/* If the gap between BSS end and heap start is larger than this we try to
195
   work around it, and if that fails, output a warning in dump-emacs.  */
196
#define MAX_HEAP_BSS_DIFF (1024*1024)
197
184
#ifdef HAVE_WINDOW_SYSTEM
198
#ifdef HAVE_WINDOW_SYSTEM
185
extern Lisp_Object Vwindow_system;
199
extern Lisp_Object Vwindow_system;
186
#endif /* HAVE_WINDOW_SYSTEM */
200
#endif /* HAVE_WINDOW_SYSTEM */
Lines 692-698 Link Here
692
      free (malloc_state_ptr);
706
      free (malloc_state_ptr);
693
    }
707
    }
694
  else
708
  else
695
    malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
709
    {
710
      if (my_heap_start == 0)
711
	my_heap_start = sbrk (0);
712
      malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
713
    }
696
}
714
}
697
715
698
void (*__malloc_initialize_hook) () = malloc_initialize_hook;
716
void (*__malloc_initialize_hook) () = malloc_initialize_hook;
Lines 725-730 Link Here
725
  stack_base = &dummy;
743
  stack_base = &dummy;
726
#endif
744
#endif
727
745
746
  if (!initialized)
747
    {
748
      extern char my_endbss[];
749
      extern char *my_endbss_static;
750
751
      if (my_heap_start == 0)
752
	my_heap_start = sbrk (0);
753
754
      heap_bss_diff = (char *)my_heap_start
755
	- (my_endbss > my_endbss_static ? my_endbss : my_endbss_static);
756
    }
757
728
#ifdef LINUX_SBRK_BUG
758
#ifdef LINUX_SBRK_BUG
729
  __sbrk (1);
759
  __sbrk (1);
730
#endif
760
#endif
Lines 763-768 Link Here
763
	}
793
	}
764
    }
794
    }
765
795
796
#ifdef HAVE_PERSONALITY_LINUX32
797
  /* See if there is a gap between the end of BSS and the heap.
798
     In that case, set personality and exec ourself again.  */
799
  if (!initialized
800
      && (strcmp (argv[argc-1], "dump") == 0
801
	  || strcmp (argv[argc-1], "bootstrap") == 0)
802
      && heap_bss_diff > MAX_HEAP_BSS_DIFF)
803
    {
804
      if (! getenv ("EMACS_HEAP_EXEC"))
805
	{
806
	  /* Set this so we only do this once.  */
807
	  putenv("EMACS_HEAP_EXEC=true");
808
809
	  /* A flag to turn off address randomization which is introduced
810
	   in linux kernel shipped with fedora core 4 */
811
#define ADD_NO_RANDOMIZE 0x0040000
812
	  personality (PER_LINUX32 | ADD_NO_RANDOMIZE);
813
#undef  ADD_NO_RANDOMIZE
814
815
	  execvp (argv[0], argv);
816
817
	  /* If the exec fails, try to dump anyway.  */
818
	  perror ("execvp");
819
	}
820
    }
821
#endif /* HAVE_PERSONALITY_LINUX32 */
822
766
/* Map in shared memory, if we are using that.  */
823
/* Map in shared memory, if we are using that.  */
767
#ifdef HAVE_SHM
824
#ifdef HAVE_SHM
768
  if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
825
  if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
(-)emacs-21.4-orig/src/lastfile.c (-2 lines)
Lines 40-46 Link Here
40
40
41
char my_edata[] = "End of Emacs initialized data";
41
char my_edata[] = "End of Emacs initialized data";
42
42
43
#ifdef WINDOWSNT
44
/* Help unexec locate the end of the .bss area used by Emacs (which
43
/* Help unexec locate the end of the .bss area used by Emacs (which
45
   isn't always a separate section in NT executables).  */
44
   isn't always a separate section in NT executables).  */
46
char my_endbss[1];
45
char my_endbss[1];
Lines 50-53 Link Here
50
   of the bss area used by Emacs.  */
49
   of the bss area used by Emacs.  */
51
static char _my_endbss[1];
50
static char _my_endbss[1];
52
char * my_endbss_static = _my_endbss;
51
char * my_endbss_static = _my_endbss;
53
#endif

Return to bug 221281