diff options
| author | Paul Eggert | 2013-02-24 21:55:37 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-02-24 21:55:37 -0800 |
| commit | 1ddc2bd6ff0b5071454d2591f835927ea5b85a06 (patch) | |
| tree | dff377164bcc7d9e8a84e0279cee6f9c28e3fcc5 | |
| parent | 82fcf982c39d5ff821bb7d3353ca973e277e1810 (diff) | |
| download | emacs-1ddc2bd6ff0b5071454d2591f835927ea5b85a06.tar.gz emacs-1ddc2bd6ff0b5071454d2591f835927ea5b85a06.zip | |
Simplify data_start configuration.
This is a followon simplification to the fix for Bug#13650.
* admin/CPP-DEFINES (DATA_START, ORDINARY_LINK): Remove.
* configure.ac (CRT_DIR, LIB_STANDARD, START_FILES, DATA_START)
(LD_FIRSTFLAG, ORDINARY_LINK, LIB_GCC): Remove.
(AC_CHECK_HEADERS_ONCE): Remove sys/resource.h, as it's
not always needed.
(HAVE_DATA_START): New macro.
* etc/PROBLEMS (LIBS_SYSTEM, LIBS_MACHINE, LIBS_STANDARD): Remove.
Remove legacy-systems section, as this stuff is no longer
applicable with current linking strategies.
* src/Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
(START_FILES): Remove. All uses removed.
(otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
(ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
(buildobj.h): Use it.
($(ALLOBJS)): Depend on globals.h.
(temacs$(EXEEXT)): Use $(ALLOBJS).
* src/autodeps.mk (ALLOBJS): Move to Makefile.in.
* src/deps.mk (vm-limit.o):
* src/makefile.w32-in ($(BLD)/vm-limit.$(O)):
Do not depend on mem-limits.h.
* src/emacs.c (__do_global_ctors, __do_global_ctors_aux)
(__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
[__GNUC__ && !ORDINARY_LINK]: Remove.
* src/mem-limits.h, src/pre-crt0.c: Remove.
* src/unexaix.c, src/unexcoff.c: Don't include mem-limits.h.
* src/unexcoff.c (etext): New decl.
(make_hdr): Use it instead of start_of_data.
* src/vm-limit.c: Move most of mem-limits.h's contents here.
(data_start): New decl. It's OK if this is approximate,
so simplify-away some unnecessary exactness.
(POINTER): Remove; all uses removed.
(data_space_start): Now char *, to avoid casts.
(exceeds_lisp_ptr): New function, replacing the old
EXCEEDS_LISP_PTR macro. All uses changed.
(check_memory_limits): Simplify and remove casts.
(start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
(memory_warnings): Use data_start instead of start_of_data.
Fixes: debbugs:13783
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | admin/CPP-DEFINES | 2 | ||||
| -rw-r--r-- | admin/ChangeLog | 5 | ||||
| -rw-r--r-- | configure.ac | 219 | ||||
| -rw-r--r-- | etc/ChangeLog | 7 | ||||
| -rw-r--r-- | etc/PROBLEMS | 35 | ||||
| -rw-r--r-- | src/ChangeLog | 33 | ||||
| -rw-r--r-- | src/Makefile.in | 34 | ||||
| -rw-r--r-- | src/autodeps.mk | 1 | ||||
| -rw-r--r-- | src/deps.mk | 2 | ||||
| -rw-r--r-- | src/emacs.c | 26 | ||||
| -rw-r--r-- | src/makefile.w32-in | 1 | ||||
| -rw-r--r-- | src/mem-limits.h | 43 | ||||
| -rw-r--r-- | src/pre-crt0.c | 10 | ||||
| -rw-r--r-- | src/unexaix.c | 2 | ||||
| -rw-r--r-- | src/unexcoff.c | 4 | ||||
| -rw-r--r-- | src/vm-limit.c | 103 |
17 files changed, 133 insertions, 403 deletions
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-02-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify data_start configuration (Bug#13783). | ||
| 4 | * configure.ac (CRT_DIR, LIB_STANDARD, START_FILES, DATA_START) | ||
| 5 | (LD_FIRSTFLAG, ORDINARY_LINK, LIB_GCC): Remove. | ||
| 6 | (AC_CHECK_HEADERS_ONCE): Remove sys/resource.h, as it's | ||
| 7 | not always needed. | ||
| 8 | (HAVE_DATA_START): New macro. | ||
| 9 | |||
| 1 | 2013-02-18 Aidan Gauland <aidalgol@no8wireless.co.nz> | 10 | 2013-02-18 Aidan Gauland <aidalgol@no8wireless.co.nz> |
| 2 | 11 | ||
| 3 | * lisp/eshell/em-cmpl.el: Corrected "context-related help" | 12 | * lisp/eshell/em-cmpl.el: Corrected "context-related help" |
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 393cf56e993..da8dec5a0f6 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -90,7 +90,6 @@ BROKEN_NON_BLOCKING_CONNECT | |||
| 90 | BROKEN_PTY_READ_AFTER_EAGAIN | 90 | BROKEN_PTY_READ_AFTER_EAGAIN |
| 91 | CLASH_DETECTION | 91 | CLASH_DETECTION |
| 92 | DATA_SEG_BITS | 92 | DATA_SEG_BITS |
| 93 | DATA_START | ||
| 94 | DEFAULT_SOUND_DEVICE | 93 | DEFAULT_SOUND_DEVICE |
| 95 | DEVICE_SEP | 94 | DEVICE_SEP |
| 96 | DIRECTORY_SEP | 95 | DIRECTORY_SEP |
| @@ -408,7 +407,6 @@ NO_EDITRES | |||
| 408 | NSIG | 407 | NSIG |
| 409 | NSIG_MINIMUM | 408 | NSIG_MINIMUM |
| 410 | NULL_DEVICE | 409 | NULL_DEVICE |
| 411 | ORDINARY_LINK | ||
| 412 | PAGESIZE | 410 | PAGESIZE |
| 413 | PREFER_VSUSP | 411 | PREFER_VSUSP |
| 414 | PTY_ITERATION | 412 | PTY_ITERATION |
diff --git a/admin/ChangeLog b/admin/ChangeLog index 7e72e10cd9f..28e25ad98a3 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify data_start configuration (Bug#13783). | ||
| 4 | * CPP-DEFINES (DATA_START, ORDINARY_LINK): Remove. | ||
| 5 | |||
| 1 | 2013-02-11 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2013-02-11 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Tune by using memchr and memrchr. | 8 | Tune by using memchr and memrchr. |
diff --git a/configure.ac b/configure.ac index 3b1b9a92b54..2d843a01a0a 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -230,12 +230,6 @@ if test "X${with_pkg_config_prog}" != X; then | |||
| 230 | fi | 230 | fi |
| 231 | fi | 231 | fi |
| 232 | 232 | ||
| 233 | CRT_DIR= | ||
| 234 | AC_ARG_WITH([crt-dir],dnl | ||
| 235 | [AS_HELP_STRING([--with-crt-dir=DIR],[directory containing crtn.o etc. | ||
| 236 | The default is /usr/lib, or /usr/lib64 on some platforms.])]) | ||
| 237 | CRT_DIR="${with_crt_dir}" | ||
| 238 | |||
| 239 | AC_ARG_WITH(gameuser,dnl | 233 | AC_ARG_WITH(gameuser,dnl |
| 240 | [AS_HELP_STRING([--with-gameuser=USER],[user for shared game score files])]) | 234 | [AS_HELP_STRING([--with-gameuser=USER],[user for shared game score files])]) |
| 241 | test "X${with_gameuser}" != X && test "${with_gameuser}" != yes \ | 235 | test "X${with_gameuser}" != X && test "${with_gameuser}" != yes \ |
| @@ -1051,42 +1045,29 @@ AC_DEFUN([AC_TYPE_UID_T]) | |||
| 1051 | 1045 | ||
| 1052 | 1046 | ||
| 1053 | LIB_MATH=-lm | 1047 | LIB_MATH=-lm |
| 1054 | LIB_STANDARD= | ||
| 1055 | START_FILES= | ||
| 1056 | dnl Current possibilities handled by sed (aix4-2 -> aix, | 1048 | dnl Current possibilities handled by sed (aix4-2 -> aix, |
| 1057 | dnl gnu-linux -> gnu/linux, etc.): | 1049 | dnl gnu-linux -> gnu/linux, etc.): |
| 1058 | dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix. | 1050 | dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix. |
| 1059 | dnl And special cases: berkeley-unix, usg-unix-v, ms-dos, windows-nt. | 1051 | dnl And special cases: berkeley-unix, usg-unix-v, ms-dos, windows-nt. |
| 1060 | SYSTEM_TYPE=`echo $opsys | sed -e 's/[[0-9]].*//' -e 's|-|/|'` | 1052 | SYSTEM_TYPE=`echo $opsys | sed -e 's/[[0-9]].*//' -e 's|-|/|'` |
| 1061 | 1053 | ||
| 1062 | dnl NB do not use CRT_DIR unquoted here, since it might not be set yet. | ||
| 1063 | case $opsys in | 1054 | case $opsys in |
| 1064 | cygwin ) | 1055 | cygwin ) |
| 1065 | LIB_MATH= | 1056 | LIB_MATH= |
| 1066 | START_FILES='pre-crt0.o' | ||
| 1067 | ;; | 1057 | ;; |
| 1068 | darwin ) | 1058 | darwin ) |
| 1069 | ## Adding -lm confuses the dynamic linker, so omit it. | 1059 | ## Adding -lm confuses the dynamic linker, so omit it. |
| 1070 | LIB_MATH= | 1060 | LIB_MATH= |
| 1071 | START_FILES='pre-crt0.o' | ||
| 1072 | ;; | 1061 | ;; |
| 1073 | freebsd ) | 1062 | freebsd ) |
| 1074 | LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o' | ||
| 1075 | START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o' | ||
| 1076 | SYSTEM_TYPE=berkeley-unix | 1063 | SYSTEM_TYPE=berkeley-unix |
| 1077 | ;; | 1064 | ;; |
| 1078 | gnu-linux | gnu-kfreebsd ) | 1065 | gnu-linux | gnu-kfreebsd ) |
| 1079 | LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o' | ||
| 1080 | START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o' | ||
| 1081 | ;; | 1066 | ;; |
| 1082 | hpux10-20 | hpux11 ) | 1067 | hpux10-20 | hpux11 ) |
| 1083 | LIB_STANDARD=-lc | ||
| 1084 | START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o' | ||
| 1085 | ;; | 1068 | ;; |
| 1086 | dnl NB this may be adjusted below. | 1069 | dnl NB this may be adjusted below. |
| 1087 | netbsd | openbsd ) | 1070 | netbsd | openbsd ) |
| 1088 | LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' | ||
| 1089 | START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' | ||
| 1090 | SYSTEM_TYPE=berkeley-unix | 1071 | SYSTEM_TYPE=berkeley-unix |
| 1091 | ;; | 1072 | ;; |
| 1092 | 1073 | ||
| @@ -1097,96 +1078,9 @@ case $opsys in | |||
| 1097 | esac | 1078 | esac |
| 1098 | 1079 | ||
| 1099 | AC_SUBST(LIB_MATH) | 1080 | AC_SUBST(LIB_MATH) |
| 1100 | AC_SUBST(START_FILES) | ||
| 1101 | AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE", | 1081 | AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE", |
| 1102 | [The type of system you are compiling for; sets `system-type'.]) | 1082 | [The type of system you are compiling for; sets `system-type'.]) |
| 1103 | 1083 | ||
| 1104 | dnl Not all platforms use crtn.o files. Check if the current one does. | ||
| 1105 | crt_files= | ||
| 1106 | |||
| 1107 | for file in x $LIB_STANDARD $START_FILES; do | ||
| 1108 | case "$file" in | ||
| 1109 | *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;; | ||
| 1110 | esac | ||
| 1111 | done | ||
| 1112 | |||
| 1113 | if test "x$crt_files" != x; then | ||
| 1114 | |||
| 1115 | ## If user specified a crt-dir, use that unconditionally. | ||
| 1116 | crt_gcc=no | ||
| 1117 | |||
| 1118 | if test "X$CRT_DIR" = "X"; then | ||
| 1119 | |||
| 1120 | CRT_DIR=/usr/lib # default | ||
| 1121 | |||
| 1122 | case "$canonical" in | ||
| 1123 | x86_64-*-linux-gnu* | s390x-*-linux-gnu*) | ||
| 1124 | ## On x86-64 and s390x GNU/Linux distributions, the standard library | ||
| 1125 | ## can be in a variety of places. We only try /usr/lib64 and /usr/lib. | ||
| 1126 | ## For anything else (eg /usr/lib32), it is up the user to specify | ||
| 1127 | ## the location (bug#5655). | ||
| 1128 | ## Test for crtn.o, not just the directory, because sometimes the | ||
| 1129 | ## directory exists but does not have the relevant files (bug#1287). | ||
| 1130 | ## FIXME better to test for binary compatibility somehow. | ||
| 1131 | test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64 | ||
| 1132 | ;; | ||
| 1133 | |||
| 1134 | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;; | ||
| 1135 | esac | ||
| 1136 | |||
| 1137 | case "$opsys" in | ||
| 1138 | hpux10-20) CRT_DIR=/lib ;; | ||
| 1139 | esac | ||
| 1140 | |||
| 1141 | test "x${GCC}" = xyes && crt_gcc=yes | ||
| 1142 | |||
| 1143 | fi # CRT_DIR = "" | ||
| 1144 | |||
| 1145 | crt_missing= | ||
| 1146 | |||
| 1147 | for file in $crt_files; do | ||
| 1148 | |||
| 1149 | ## If we're using gcc, try to determine it automatically by asking | ||
| 1150 | ## gcc. [If this doesn't work, CRT_DIR will remain at the | ||
| 1151 | ## system-dependent default from above.] | ||
| 1152 | if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then | ||
| 1153 | |||
| 1154 | crt_file=`$CC --print-file-name=$file 2>/dev/null` | ||
| 1155 | case "$crt_file" in | ||
| 1156 | */*) | ||
| 1157 | CRT_DIR=`AS_DIRNAME(["$crt_file"])` | ||
| 1158 | ;; | ||
| 1159 | esac | ||
| 1160 | fi | ||
| 1161 | |||
| 1162 | dnl We expect all the files to be in a single directory, so after the | ||
| 1163 | dnl first there is no point asking gcc. | ||
| 1164 | crt_gcc=no | ||
| 1165 | |||
| 1166 | test -e $CRT_DIR/$file || crt_missing="$crt_missing $file" | ||
| 1167 | done # $crt_files | ||
| 1168 | |||
| 1169 | test "x$crt_missing" = x || \ | ||
| 1170 | AC_MSG_ERROR([Required file(s) not found:$crt_missing | ||
| 1171 | Try using the --with-crt-dir option.]) | ||
| 1172 | |||
| 1173 | fi # crt_files != "" | ||
| 1174 | |||
| 1175 | AC_SUBST(CRT_DIR) | ||
| 1176 | |||
| 1177 | case $opsys in | ||
| 1178 | netbsd | openbsd ) | ||
| 1179 | if test -f $CRT_DIR/crti.o; then | ||
| 1180 | |||
| 1181 | test -f $CRT_DIR/crtn.o || \ | ||
| 1182 | AC_MSG_ERROR([Required file not found: crtn.o]) | ||
| 1183 | |||
| 1184 | LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' | ||
| 1185 | START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' | ||
| 1186 | fi | ||
| 1187 | ;; | ||
| 1188 | esac | ||
| 1189 | |||
| 1190 | 1084 | ||
| 1191 | pre_PKG_CONFIG_CFLAGS=$CFLAGS | 1085 | pre_PKG_CONFIG_CFLAGS=$CFLAGS |
| 1192 | pre_PKG_CONFIG_LIBS=$LIBS | 1086 | pre_PKG_CONFIG_LIBS=$LIBS |
| @@ -1304,7 +1198,7 @@ dnl checks for header files | |||
| 1304 | AC_CHECK_HEADERS_ONCE( | 1198 | AC_CHECK_HEADERS_ONCE( |
| 1305 | linux/version.h sys/systeminfo.h | 1199 | linux/version.h sys/systeminfo.h |
| 1306 | coff.h pty.h | 1200 | coff.h pty.h |
| 1307 | sys/vlimit.h sys/resource.h | 1201 | sys/resource.h |
| 1308 | sys/utsname.h pwd.h utmp.h util.h) | 1202 | sys/utsname.h pwd.h utmp.h util.h) |
| 1309 | 1203 | ||
| 1310 | AC_MSG_CHECKING(if personality LINUX32 can be set) | 1204 | AC_MSG_CHECKING(if personality LINUX32 can be set) |
| @@ -1521,8 +1415,6 @@ if test "${with_ns}" != no; then | |||
| 1521 | CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" | 1415 | CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" |
| 1522 | LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}" | 1416 | LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}" |
| 1523 | LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread" | 1417 | LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread" |
| 1524 | LIB_STANDARD= | ||
| 1525 | START_FILES= | ||
| 1526 | dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1. | 1418 | dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1. |
| 1527 | dnl If they had chosen to either define it or not, we could have | 1419 | dnl If they had chosen to either define it or not, we could have |
| 1528 | dnl just used AC_CHECK_DECL here. | 1420 | dnl just used AC_CHECK_DECL here. |
| @@ -1611,7 +1503,6 @@ AC_SUBST(INSTALL_ARCH_INDEP_EXTRA) | |||
| 1611 | AC_SUBST(ns_self_contained) | 1503 | AC_SUBST(ns_self_contained) |
| 1612 | AC_SUBST(NS_OBJ) | 1504 | AC_SUBST(NS_OBJ) |
| 1613 | AC_SUBST(NS_OBJC_OBJ) | 1505 | AC_SUBST(NS_OBJC_OBJ) |
| 1614 | AC_SUBST(LIB_STANDARD) | ||
| 1615 | 1506 | ||
| 1616 | HAVE_W32=no | 1507 | HAVE_W32=no |
| 1617 | W32_OBJ= | 1508 | W32_OBJ= |
| @@ -1751,6 +1642,20 @@ if test "${system_malloc}" = "yes"; then | |||
| 1751 | else | 1642 | else |
| 1752 | test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o | 1643 | test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o |
| 1753 | VMLIMIT_OBJ=vm-limit.o | 1644 | VMLIMIT_OBJ=vm-limit.o |
| 1645 | |||
| 1646 | AC_CHECK_HEADERS([sys/vlimit.h]) | ||
| 1647 | AC_CACHE_CHECK([for data_start], [emacs_cv_data_start], | ||
| 1648 | [AC_LINK_IFELSE( | ||
| 1649 | [AC_LANG_PROGRAM( | ||
| 1650 | [[extern char data_start[]; char ch;]], | ||
| 1651 | [[return data_start == &ch;]])], | ||
| 1652 | [emacs_cv_data_start=yes], | ||
| 1653 | [emacs_cv_data_start=no])]) | ||
| 1654 | if test $emacs_cv_data_start = yes; then | ||
| 1655 | AC_DEFINE([HAVE_DATA_START], 1, | ||
| 1656 | [Define to 1 if data_start is the address of the start | ||
| 1657 | of the main data segment.]) | ||
| 1658 | fi | ||
| 1754 | fi | 1659 | fi |
| 1755 | AC_SUBST(GMALLOC_OBJ) | 1660 | AC_SUBST(GMALLOC_OBJ) |
| 1756 | AC_SUBST(VMLIMIT_OBJ) | 1661 | AC_SUBST(VMLIMIT_OBJ) |
| @@ -3735,9 +3640,7 @@ case $opsys in | |||
| 3735 | esac | 3640 | esac |
| 3736 | 3641 | ||
| 3737 | 3642 | ||
| 3738 | dnl Used in vm-limit.c | 3643 | dnl Used in lisp.h, emacs.c, vm-limit.c |
| 3739 | AH_TEMPLATE(DATA_START, [Address of the start of the data segment.]) | ||
| 3740 | dnl Used in lisp.h, emacs.c, mem-limits.h | ||
| 3741 | dnl NEWS.18 describes this as "a number which contains | 3644 | dnl NEWS.18 describes this as "a number which contains |
| 3742 | dnl the high bits to be inclusive or'ed with pointers that are unpacked." | 3645 | dnl the high bits to be inclusive or'ed with pointers that are unpacked." |
| 3743 | AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers | 3646 | AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers |
| @@ -3745,23 +3648,15 @@ stored in a Lisp_Object.]) | |||
| 3745 | dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT. | 3648 | dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT. |
| 3746 | 3649 | ||
| 3747 | case $opsys in | 3650 | case $opsys in |
| 3748 | gnu) | ||
| 3749 | dnl libc defines data_start. | ||
| 3750 | AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })]) | ||
| 3751 | ;; | ||
| 3752 | |||
| 3753 | aix*) | 3651 | aix*) |
| 3754 | dnl This works with 32-bit executables; Emacs doesn't support 64-bit. | 3652 | dnl This works with 32-bit executables; Emacs doesn't support 64-bit. |
| 3755 | AC_DEFINE(DATA_START, [0x20000000]) | ||
| 3756 | AC_DEFINE(DATA_SEG_BITS, [0x20000000]) | 3653 | AC_DEFINE(DATA_SEG_BITS, [0x20000000]) |
| 3757 | ;; | 3654 | ;; |
| 3758 | hpux*) | 3655 | hpux*) |
| 3759 | dnl The data segment on this machine always starts at address 0x40000000. | 3656 | dnl The data segment on this machine always starts at address 0x40000000. |
| 3760 | AC_DEFINE(DATA_START, [0x40000000]) | ||
| 3761 | AC_DEFINE(DATA_SEG_BITS, [0x40000000]) | 3657 | AC_DEFINE(DATA_SEG_BITS, [0x40000000]) |
| 3762 | ;; | 3658 | ;; |
| 3763 | irix6-5) | 3659 | irix6-5) |
| 3764 | AC_DEFINE(DATA_START, [0x10000000]) | ||
| 3765 | AC_DEFINE(DATA_SEG_BITS, [0x10000000]) | 3660 | AC_DEFINE(DATA_SEG_BITS, [0x10000000]) |
| 3766 | ;; | 3661 | ;; |
| 3767 | esac | 3662 | esac |
| @@ -4321,88 +4216,6 @@ esac | |||
| 4321 | 4216 | ||
| 4322 | AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) | 4217 | AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) |
| 4323 | 4218 | ||
| 4324 | |||
| 4325 | LD_FIRSTFLAG= | ||
| 4326 | ORDINARY_LINK= | ||
| 4327 | case "$opsys" in | ||
| 4328 | ## gnu: GNU needs its own crt0. | ||
| 4329 | aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;; | ||
| 4330 | |||
| 4331 | ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the | ||
| 4332 | ## library search parth, i.e. it won't search /usr/lib for libc and | ||
| 4333 | ## friends. Using -nostartfiles instead avoids this problem, and | ||
| 4334 | ## will also work on earlier NetBSD releases. | ||
| 4335 | netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;; | ||
| 4336 | |||
| 4337 | ## powerpc*: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says | ||
| 4338 | ## MkLinux/LinuxPPC needs this. | ||
| 4339 | ## s390x-* only supports opsys = gnu-linux so it can be added here. | ||
| 4340 | gnu-*) | ||
| 4341 | case "$canonical" in | ||
| 4342 | powerpc*|s390x-*) LD_FIRSTFLAG="-nostdlib" ;; | ||
| 4343 | esac | ||
| 4344 | ;; | ||
| 4345 | esac | ||
| 4346 | |||
| 4347 | |||
| 4348 | if test "x$ORDINARY_LINK" = "xyes"; then | ||
| 4349 | |||
| 4350 | LD_FIRSTFLAG="" | ||
| 4351 | AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.]) | ||
| 4352 | |||
| 4353 | ## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are: | ||
| 4354 | ## freebsd, gnu-* not on powerpc*|s390x*. | ||
| 4355 | elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then | ||
| 4356 | |||
| 4357 | ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure | ||
| 4358 | ## places that are difficult to figure out at make time. Fortunately, | ||
| 4359 | ## these same versions allow you to pass arbitrary flags on to the | ||
| 4360 | ## linker, so there is no reason not to use it as a linker. | ||
| 4361 | ## | ||
| 4362 | ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from | ||
| 4363 | ## searching for libraries in its internal directories, so we have to | ||
| 4364 | ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). | ||
| 4365 | LD_FIRSTFLAG="-nostdlib" | ||
| 4366 | fi | ||
| 4367 | |||
| 4368 | ## FIXME? What setting of EDIT_LDFLAGS should this have? | ||
| 4369 | test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic" | ||
| 4370 | |||
| 4371 | AC_SUBST(LD_FIRSTFLAG) | ||
| 4372 | |||
| 4373 | |||
| 4374 | ## FIXME? The logic here is not precisely the same as that above. | ||
| 4375 | ## There is no check here for a pre-defined LD_FIRSTFLAG. | ||
| 4376 | ## Should we only be setting LIB_GCC if LD ~ -nostdlib? | ||
| 4377 | LIB_GCC= | ||
| 4378 | if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then | ||
| 4379 | |||
| 4380 | case "$opsys" in | ||
| 4381 | freebsd|netbsd|openbsd) LIB_GCC= ;; | ||
| 4382 | |||
| 4383 | gnu-*) | ||
| 4384 | ## armin76@gentoo.org reported that the lgcc_s flag is necessary to | ||
| 4385 | ## build on ARM EABI under GNU/Linux. (Bug#5518) | ||
| 4386 | case $host_cpu in | ||
| 4387 | arm*) | ||
| 4388 | LIB_GCC="-lgcc_s" | ||
| 4389 | ;; | ||
| 4390 | *) | ||
| 4391 | ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then | ||
| 4392 | ## immediately undefine it again and redefine it to empty. | ||
| 4393 | ## Was the C_SWITCH_X_SITE part really necessary? | ||
| 4394 | ## LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name` | ||
| 4395 | LIB_GCC= | ||
| 4396 | ;; | ||
| 4397 | esac | ||
| 4398 | ;; | ||
| 4399 | |||
| 4400 | ## Ask GCC where to find libgcc.a. | ||
| 4401 | *) LIB_GCC=`$CC -print-libgcc-file-name 2> /dev/null` ;; | ||
| 4402 | esac | ||
| 4403 | fi dnl if $GCC | ||
| 4404 | AC_SUBST(LIB_GCC) | ||
| 4405 | |||
| 4406 | ## Common for all window systems | 4219 | ## Common for all window systems |
| 4407 | if test "$window_system" != "none"; then | 4220 | if test "$window_system" != "none"; then |
| 4408 | AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) | 4221 | AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 2e0eb2d7056..49d03227c48 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-02-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify data_start configuration (Bug#13783). | ||
| 4 | * PROBLEMS (LIBS_SYSTEM, LIBS_MACHINE, LIBS_STANDARD): Remove. | ||
| 5 | Remove legacy-systems section, as this stuff is no longer | ||
| 6 | applicable with current linking strategies. | ||
| 7 | |||
| 1 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> | 8 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 9 | ||
| 3 | * NEWS: Tramp methods "scpc" and "rsyncc" are discontinued. | 10 | * NEWS: Tramp methods "scpc" and "rsyncc" are discontinued. |
diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 441ad7b4df4..b38a1240540 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS | |||
| @@ -432,21 +432,7 @@ The fix is to install an unshared library that corresponds to what you | |||
| 432 | installed in the shared library, and then relink Emacs. | 432 | installed in the shared library, and then relink Emacs. |
| 433 | 433 | ||
| 434 | If you have already installed the name resolver in the file libresolv.a, | 434 | If you have already installed the name resolver in the file libresolv.a, |
| 435 | then you need to compile Emacs to use that library. The easiest way to | 435 | then you need to compile Emacs to use that library. |
| 436 | do this is to add to config.h a definition of LIBS_SYSTEM, LIBS_MACHINE | ||
| 437 | or LIB_STANDARD which uses -lresolv. Watch out! If you redefine a macro | ||
| 438 | that is already in use in your configuration to supply some other libraries, | ||
| 439 | be careful not to lose the others. | ||
| 440 | |||
| 441 | Thus, you could start by adding this to config.h: | ||
| 442 | |||
| 443 | #define LIBS_SYSTEM -lresolv | ||
| 444 | |||
| 445 | Then if this gives you an error for redefining a macro, and you see that | ||
| 446 | config.h already defines LIBS_SYSTEM as -lfoo -lbar at some other point | ||
| 447 | (possibly in an included file) you could change it to say this: | ||
| 448 | |||
| 449 | #define LIBS_SYSTEM -lresolv -lfoo -lbar | ||
| 450 | 436 | ||
| 451 | *** Emacs does not know your host's fully-qualified domain name. | 437 | *** Emacs does not know your host's fully-qualified domain name. |
| 452 | 438 | ||
| @@ -3179,25 +3165,6 @@ as a concentrator. | |||
| 3179 | 3165 | ||
| 3180 | This problem seems to be a matter of configuring the DECserver to use | 3166 | This problem seems to be a matter of configuring the DECserver to use |
| 3181 | 7 bit characters rather than 8 bit characters. | 3167 | 7 bit characters rather than 8 bit characters. |
| 3182 | |||
| 3183 | * Build problems on legacy systems | ||
| 3184 | |||
| 3185 | ** SunOS: Emacs gets error message from linker on Sun. | ||
| 3186 | |||
| 3187 | If the error message says that a symbol such as `f68881_used' or | ||
| 3188 | `ffpa_used' or `start_float' is undefined, this probably indicates | ||
| 3189 | that you have compiled some libraries, such as the X libraries, | ||
| 3190 | with a floating point option other than the default. | ||
| 3191 | |||
| 3192 | It's not terribly hard to make this work with small changes in | ||
| 3193 | crt0.c together with linking with Fcrt1.o, Wcrt1.o or Mcrt1.o. | ||
| 3194 | However, the easiest approach is to build Xlib with the default | ||
| 3195 | floating point option: -fsoft. | ||
| 3196 | |||
| 3197 | ** HPUX 10.20: Emacs crashes during dumping on the HPPA machine. | ||
| 3198 | |||
| 3199 | This seems to be due to a GCC bug; it is fixed in GCC 2.8.1. | ||
| 3200 | |||
| 3201 | 3168 | ||
| 3202 | This file is part of GNU Emacs. | 3169 | This file is part of GNU Emacs. |
| 3203 | 3170 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 8d3fc1e56fb..00d1f30dd46 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,36 @@ | |||
| 1 | 2013-02-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify data_start configuration (Bug#13783). | ||
| 4 | This is a followon simplification to the fix for Bug#13650. | ||
| 5 | * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD) | ||
| 6 | (START_FILES): Remove. All uses removed. | ||
| 7 | (otherobj): Remove $(VMLIMIT_OBJ), as it's now first. | ||
| 8 | (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first. | ||
| 9 | (buildobj.h): Use it. | ||
| 10 | ($(ALLOBJS)): Depend on globals.h. | ||
| 11 | (temacs$(EXEEXT)): Use $(ALLOBJS). | ||
| 12 | * autodeps.mk (ALLOBJS): Move to Makefile.in. | ||
| 13 | * deps.mk (vm-limit.o): | ||
| 14 | * makefile.w32-in ($(BLD)/vm-limit.$(O)): | ||
| 15 | Do not depend on mem-limits.h. | ||
| 16 | * emacs.c (__do_global_ctors, __do_global_ctors_aux) | ||
| 17 | (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__) | ||
| 18 | [__GNUC__ && !ORDINARY_LINK]: Remove. | ||
| 19 | * mem-limits.h, pre-crt0.c: Remove. | ||
| 20 | * unexaix.c, unexcoff.c: Don't include mem-limits.h. | ||
| 21 | * unexcoff.c (etext): New decl. | ||
| 22 | (make_hdr): Use DATA_START instead of start_of_data. | ||
| 23 | * vm-limit.c: Move most of mem-limits.h's contents here. | ||
| 24 | (data_start): New decl. It's OK if this is approximate, | ||
| 25 | so simplify-away some unnecessary exactness. | ||
| 26 | (POINTER): Remove; all uses removed. | ||
| 27 | (data_space_start): Now char *, to avoid casts. | ||
| 28 | (exceeds_lisp_ptr): New function, replacing the old | ||
| 29 | EXCEEDS_LISP_PTR macro. All uses changed. | ||
| 30 | (check_memory_limits): Simplify and remove casts. | ||
| 31 | (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove. | ||
| 32 | (memory_warnings): Use data_start instead of start_of_data. | ||
| 33 | |||
| 1 | 2013-02-24 Andreas Schwab <schwab@linux-m68k.org> | 34 | 2013-02-24 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 35 | ||
| 3 | * xdisp.c (set_message): Only check for debug-on-message if STRING | 36 | * xdisp.c (set_message): Only check for debug-on-message if STRING |
diff --git a/src/Makefile.in b/src/Makefile.in index 6ee03177861..b2034a3379d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -36,7 +36,6 @@ WINDRES = @WINDRES@ | |||
| 36 | CFLAGS = @CFLAGS@ | 36 | CFLAGS = @CFLAGS@ |
| 37 | CPPFLAGS = @CPPFLAGS@ | 37 | CPPFLAGS = @CPPFLAGS@ |
| 38 | LDFLAGS = @LDFLAGS@ | 38 | LDFLAGS = @LDFLAGS@ |
| 39 | LD_FIRSTFLAG=@LD_FIRSTFLAG@ | ||
| 40 | EXEEXT = @EXEEXT@ | 39 | EXEEXT = @EXEEXT@ |
| 41 | version = @version@ | 40 | version = @version@ |
| 42 | # Substitute an assignment for the MAKE variable, because | 41 | # Substitute an assignment for the MAKE variable, because |
| @@ -102,10 +101,8 @@ LD_SWITCH_X_SITE_RPATH=@LD_SWITCH_X_SITE_RPATH@ | |||
| 102 | ## System-specific LDFLAGS. | 101 | ## System-specific LDFLAGS. |
| 103 | LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@ | 102 | LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@ |
| 104 | 103 | ||
| 105 | ## This holds any special options for linking temacs only (ie, not | 104 | ## This holds any special options for linking temacs only (i.e., not |
| 106 | ## used by configure). Not used elsewhere because it sometimes | 105 | ## used by configure). |
| 107 | ## contains options that have to do with using Emacs's crt0, | ||
| 108 | ## which are only good with temacs. | ||
| 109 | LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ | 106 | LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ |
| 110 | 107 | ||
| 111 | ## Flags to pass to ld only for temacs. | 108 | ## Flags to pass to ld only for temacs. |
| @@ -120,14 +117,6 @@ PAXCTL = @PAXCTL@ | |||
| 120 | ## Some systems define this to request special libraries. | 117 | ## Some systems define this to request special libraries. |
| 121 | LIBS_SYSTEM=@LIBS_SYSTEM@ | 118 | LIBS_SYSTEM=@LIBS_SYSTEM@ |
| 122 | 119 | ||
| 123 | ## Where to find libgcc.a, if using gcc and necessary. | ||
| 124 | LIB_GCC=@LIB_GCC@ | ||
| 125 | |||
| 126 | CRT_DIR=@CRT_DIR@ | ||
| 127 | ## May use $CRT_DIR. | ||
| 128 | LIB_STANDARD=@LIB_STANDARD@ | ||
| 129 | START_FILES = @START_FILES@ | ||
| 130 | |||
| 131 | ## -lm, or empty. | 120 | ## -lm, or empty. |
| 132 | LIB_MATH=@LIB_MATH@ | 121 | LIB_MATH=@LIB_MATH@ |
| 133 | 122 | ||
| @@ -389,17 +378,16 @@ POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ | |||
| 389 | 378 | ||
| 390 | ## List of object files that make-docfile should not be told about. | 379 | ## List of object files that make-docfile should not be told about. |
| 391 | otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ | 380 | otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ |
| 392 | $(POST_ALLOC_OBJ) $(VMLIMIT_OBJ) $(WIDGET_OBJ) $(LIBOBJS) | 381 | $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) |
| 393 | 382 | ||
| 383 | ## All object files linked into temacs. $(VMLIMIT_OBJ) should be first. | ||
| 384 | ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj) | ||
| 394 | 385 | ||
| 395 | ## Configure inserts the file lisp.mk at this point, defining $lisp. | 386 | ## Configure inserts the file lisp.mk at this point, defining $lisp. |
| 396 | @lisp_frag@ | 387 | @lisp_frag@ |
| 397 | 388 | ||
| 398 | 389 | ||
| 399 | ## Construct full set of libraries to be linked. | 390 | ## Construct full set of libraries to be linked. |
| 400 | ## Note that SunOS needs -lm to come before -lc; otherwise, you get | ||
| 401 | ## duplicated symbols. If the standard libraries were compiled | ||
| 402 | ## with GCC, we might need LIB_GCC again after them. | ||
| 403 | LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ | 391 | LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ |
| 404 | $(LIBX_OTHER) $(LIBSOUND) \ | 392 | $(LIBX_OTHER) $(LIBSOUND) \ |
| 405 | $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \ | 393 | $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \ |
| @@ -409,7 +397,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ | |||
| 409 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ | 397 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ |
| 410 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ | 398 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ |
| 411 | $(LIBACL_LIBS) $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \ | 399 | $(LIBACL_LIBS) $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \ |
| 412 | $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) | 400 | $(LIB_MATH) |
| 413 | 401 | ||
| 414 | all: emacs$(EXEEXT) $(OTHER_FILES) | 402 | all: emacs$(EXEEXT) $(OTHER_FILES) |
| 415 | .PHONY: all | 403 | .PHONY: all |
| @@ -456,7 +444,7 @@ $(libsrc)/make-docfile$(EXEEXT): | |||
| 456 | cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT) | 444 | cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT) |
| 457 | 445 | ||
| 458 | buildobj.h: Makefile | 446 | buildobj.h: Makefile |
| 459 | echo "#define BUILDOBJ \"$(obj) $(otherobj) " "\"" > buildobj.h | 447 | echo "#define BUILDOBJ \"$(ALLOBJS) " "\"" >$@ |
| 460 | 448 | ||
| 461 | globals.h: gl-stamp; @true | 449 | globals.h: gl-stamp; @true |
| 462 | 450 | ||
| @@ -468,15 +456,15 @@ gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) | |||
| 468 | $(srcdir)/../build-aux/move-if-change gl-tmp globals.h | 456 | $(srcdir)/../build-aux/move-if-change gl-tmp globals.h |
| 469 | echo timestamp > $@ | 457 | echo timestamp > $@ |
| 470 | 458 | ||
| 471 | $(obj) $(otherobj): globals.h | 459 | $(ALLOBJS): globals.h |
| 472 | 460 | ||
| 473 | $(lib)/libgnu.a: $(config_h) | 461 | $(lib)/libgnu.a: $(config_h) |
| 474 | cd $(lib) && $(MAKE) libgnu.a | 462 | cd $(lib) && $(MAKE) libgnu.a |
| 475 | 463 | ||
| 476 | temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \ | 464 | temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \ |
| 477 | $(lib)/libgnu.a $(W32_RES) | 465 | $(lib)/libgnu.a $(W32_RES) |
| 478 | $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ | 466 | $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ |
| 479 | -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \ | 467 | -o temacs $(ALLOBJS) $(lib)/libgnu.a $(LIBES) \ |
| 480 | $(W32_RES_LINK) | 468 | $(W32_RES_LINK) |
| 481 | test "$(CANNOT_DUMP)" = "yes" || \ | 469 | test "$(CANNOT_DUMP)" = "yes" || \ |
| 482 | test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) | 470 | test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) |
diff --git a/src/autodeps.mk b/src/autodeps.mk index fb0e21366c7..8b014a7508c 100644 --- a/src/autodeps.mk +++ b/src/autodeps.mk | |||
| @@ -2,5 +2,4 @@ | |||
| 2 | 2 | ||
| 3 | ## This is inserted in src/Makefile if AUTO_DEPEND=yes. | 3 | ## This is inserted in src/Makefile if AUTO_DEPEND=yes. |
| 4 | 4 | ||
| 5 | ALLOBJS=$(START_FILES) ${obj} ${otherobj} | ||
| 6 | -include $(ALLOBJS:%.o=${DEPDIR}/%.d) | 5 | -include $(ALLOBJS:%.o=${DEPDIR}/%.d) |
diff --git a/src/deps.mk b/src/deps.mk index 47185c9262c..83444474c59 100644 --- a/src/deps.mk +++ b/src/deps.mk | |||
| @@ -144,7 +144,7 @@ macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h msdos.h \ | |||
| 144 | dispextern.h lisp.h globals.h $(config_h) systime.h coding.h composite.h | 144 | dispextern.h lisp.h globals.h $(config_h) systime.h coding.h composite.h |
| 145 | gmalloc.o: gmalloc.c $(config_h) | 145 | gmalloc.o: gmalloc.c $(config_h) |
| 146 | ralloc.o: ralloc.c lisp.h $(config_h) | 146 | ralloc.o: ralloc.c lisp.h $(config_h) |
| 147 | vm-limit.o: vm-limit.c mem-limits.h lisp.h globals.h $(config_h) | 147 | vm-limit.o: vm-limit.c lisp.h globals.h $(config_h) |
| 148 | marker.o: marker.c buffer.h character.h lisp.h globals.h $(config_h) | 148 | marker.o: marker.c buffer.h character.h lisp.h globals.h $(config_h) |
| 149 | minibuf.o: minibuf.c syntax.h frame.h window.h keyboard.h systime.h \ | 149 | minibuf.o: minibuf.c syntax.h frame.h window.h keyboard.h systime.h \ |
| 150 | buffer.h commands.h character.h msdos.h $(INTERVALS_H) keymap.h \ | 150 | buffer.h commands.h character.h msdos.h $(INTERVALS_H) keymap.h \ |
diff --git a/src/emacs.c b/src/emacs.c index c494dff8cac..b96076b1340 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -521,32 +521,6 @@ DEFUN ("invocation-directory", Finvocation_directory, Sinvocation_directory, | |||
| 521 | static char const dump_tz[] = "UtC0"; | 521 | static char const dump_tz[] = "UtC0"; |
| 522 | #endif | 522 | #endif |
| 523 | 523 | ||
| 524 | #ifndef ORDINARY_LINK | ||
| 525 | /* We don't include crtbegin.o and crtend.o in the link, | ||
| 526 | so these functions and variables might be missed. | ||
| 527 | Provide dummy definitions to avoid error. | ||
| 528 | (We don't have any real constructors or destructors.) */ | ||
| 529 | #ifdef __GNUC__ | ||
| 530 | |||
| 531 | /* Define a dummy function F. Declare F too, to pacify gcc | ||
| 532 | -Wmissing-prototypes. */ | ||
| 533 | #define DEFINE_DUMMY_FUNCTION(f) \ | ||
| 534 | void f (void) ATTRIBUTE_CONST EXTERNALLY_VISIBLE; void f (void) {} | ||
| 535 | |||
| 536 | #ifndef GCC_CTORS_IN_LIBC | ||
| 537 | DEFINE_DUMMY_FUNCTION (__do_global_ctors) | ||
| 538 | DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux) | ||
| 539 | DEFINE_DUMMY_FUNCTION (__do_global_dtors) | ||
| 540 | /* GNU/Linux has a bug in its library; avoid an error. */ | ||
| 541 | #ifndef GNU_LINUX | ||
| 542 | char * __CTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 }; | ||
| 543 | #endif | ||
| 544 | char * __DTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 }; | ||
| 545 | #endif /* GCC_CTORS_IN_LIBC */ | ||
| 546 | DEFINE_DUMMY_FUNCTION (__main) | ||
| 547 | #endif /* __GNUC__ */ | ||
| 548 | #endif /* ORDINARY_LINK */ | ||
| 549 | |||
| 550 | /* Test whether the next argument in ARGV matches SSTR or a prefix of | 524 | /* Test whether the next argument in ARGV matches SSTR or a prefix of |
| 551 | LSTR (at least MINLEN characters). If so, then if VALPTR is non-null | 525 | LSTR (at least MINLEN characters). If so, then if VALPTR is non-null |
| 552 | (the argument is supposed to have a value) store in *VALPTR either | 526 | (the argument is supposed to have a value) store in *VALPTR either |
diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 6e1873f8e49..d60331198db 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in | |||
| @@ -1492,7 +1492,6 @@ $(BLD)/unexw32.$(O) : \ | |||
| 1492 | 1492 | ||
| 1493 | $(BLD)/vm-limit.$(O) : \ | 1493 | $(BLD)/vm-limit.$(O) : \ |
| 1494 | $(SRC)/vm-limit.c \ | 1494 | $(SRC)/vm-limit.c \ |
| 1495 | $(SRC)/mem-limits.h \ | ||
| 1496 | $(SRC)/w32heap.h \ | 1495 | $(SRC)/w32heap.h \ |
| 1497 | $(NT_INC)/unistd.h \ | 1496 | $(NT_INC)/unistd.h \ |
| 1498 | $(CONFIG_H) \ | 1497 | $(CONFIG_H) \ |
diff --git a/src/mem-limits.h b/src/mem-limits.h deleted file mode 100644 index 941ccf5f121..00000000000 --- a/src/mem-limits.h +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /* Includes for memory limit warnings. | ||
| 2 | Copyright (C) 1990, 1993-1996, 2001-2013 Free Software Foundation, | ||
| 3 | Inc. | ||
| 4 | |||
| 5 | This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or | ||
| 10 | (at your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | #ifdef MSDOS | ||
| 21 | #include <dpmi.h> | ||
| 22 | extern int etext; | ||
| 23 | #endif | ||
| 24 | |||
| 25 | /* Some systems need this before <sys/resource.h>. */ | ||
| 26 | #include <sys/types.h> | ||
| 27 | |||
| 28 | #ifdef HAVE_SYS_RESOURCE_H | ||
| 29 | # include <sys/time.h> | ||
| 30 | # include <sys/resource.h> | ||
| 31 | #else | ||
| 32 | # if HAVE_SYS_VLIMIT_H | ||
| 33 | # include <sys/vlimit.h> /* Obsolete, says glibc */ | ||
| 34 | # endif | ||
| 35 | #endif | ||
| 36 | |||
| 37 | extern char *start_of_data (void) ATTRIBUTE_CONST; | ||
| 38 | #if USE_LSB_TAG || UINTPTR_MAX <= VAL_MAX | ||
| 39 | #define EXCEEDS_LISP_PTR(ptr) 0 | ||
| 40 | #else | ||
| 41 | #define EXCEEDS_LISP_PTR(ptr) \ | ||
| 42 | (((uintptr_t) (ptr) & ~DATA_SEG_BITS) >> VALBITS) | ||
| 43 | #endif | ||
diff --git a/src/pre-crt0.c b/src/pre-crt0.c deleted file mode 100644 index 6b9618c8dc3..00000000000 --- a/src/pre-crt0.c +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | /* This file is loaded before crt0.o on machines where we do not | ||
| 2 | remap part of the data space into text space in unexec. | ||
| 3 | On these machines, there is no problem with standard crt0.o's | ||
| 4 | that make environ an initialized variable. However, we do | ||
| 5 | need to make sure the label data_start exists anyway. */ | ||
| 6 | |||
| 7 | /* Create a label to appear at the beginning of data space. | ||
| 8 | Its value is nonzero so that it cannot be put into bss. */ | ||
| 9 | |||
| 10 | int data_start = 1; | ||
diff --git a/src/unexaix.c b/src/unexaix.c index da44480fdca..44a824b8c12 100644 --- a/src/unexaix.c +++ b/src/unexaix.c | |||
| @@ -59,8 +59,6 @@ what you give them. Help stamp out software-hoarding! */ | |||
| 59 | #include <unistd.h> | 59 | #include <unistd.h> |
| 60 | #include <fcntl.h> | 60 | #include <fcntl.h> |
| 61 | 61 | ||
| 62 | #include "mem-limits.h" | ||
| 63 | |||
| 64 | extern char _data[]; | 62 | extern char _data[]; |
| 65 | extern char _text[]; | 63 | extern char _text[]; |
| 66 | 64 | ||
diff --git a/src/unexcoff.c b/src/unexcoff.c index 466a5c0e491..2e662a34145 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c | |||
| @@ -99,7 +99,7 @@ struct aouthdr | |||
| 99 | 99 | ||
| 100 | #include <sys/file.h> | 100 | #include <sys/file.h> |
| 101 | 101 | ||
| 102 | #include "mem-limits.h" | 102 | extern int etext; |
| 103 | 103 | ||
| 104 | static long block_copy_start; /* Old executable start point */ | 104 | static long block_copy_start; /* Old executable start point */ |
| 105 | static struct filehdr f_hdr; /* File header */ | 105 | static struct filehdr f_hdr; /* File header */ |
| @@ -168,7 +168,7 @@ make_hdr (int new, int a_out, | |||
| 168 | pagemask = getpagesize () - 1; | 168 | pagemask = getpagesize () - 1; |
| 169 | 169 | ||
| 170 | /* Adjust text/data boundary. */ | 170 | /* Adjust text/data boundary. */ |
| 171 | data_start = (int) start_of_data (); | 171 | data_start = (int) DATA_START; |
| 172 | data_start = ADDR_CORRECT (data_start); | 172 | data_start = ADDR_CORRECT (data_start); |
| 173 | data_start = data_start & ~pagemask; /* (Down) to page boundary. */ | 173 | data_start = data_start & ~pagemask; /* (Down) to page boundary. */ |
| 174 | 174 | ||
diff --git a/src/vm-limit.c b/src/vm-limit.c index fc7a253325a..3fca8bd26c1 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c | |||
| @@ -19,7 +19,37 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 19 | #include <config.h> | 19 | #include <config.h> |
| 20 | #include <unistd.h> /* for 'environ', on AIX */ | 20 | #include <unistd.h> /* for 'environ', on AIX */ |
| 21 | #include "lisp.h" | 21 | #include "lisp.h" |
| 22 | #include "mem-limits.h" | 22 | |
| 23 | #ifdef MSDOS | ||
| 24 | #include <dpmi.h> | ||
| 25 | extern int etext; | ||
| 26 | #endif | ||
| 27 | |||
| 28 | /* Some systems need this before <sys/resource.h>. */ | ||
| 29 | #include <sys/types.h> | ||
| 30 | |||
| 31 | #ifdef HAVE_SYS_RESOURCE_H | ||
| 32 | # include <sys/time.h> | ||
| 33 | # include <sys/resource.h> | ||
| 34 | #else | ||
| 35 | # if HAVE_SYS_VLIMIT_H | ||
| 36 | # include <sys/vlimit.h> /* Obsolete, says glibc */ | ||
| 37 | # endif | ||
| 38 | #endif | ||
| 39 | |||
| 40 | /* Start of data. It is OK if this is approximate; it's used only as | ||
| 41 | a heuristic. */ | ||
| 42 | #ifdef DATA_START | ||
| 43 | # define data_start ((char *) DATA_START) | ||
| 44 | #else | ||
| 45 | extern char data_start[]; | ||
| 46 | # ifndef HAVE_DATA_START | ||
| 47 | /* Initialize to nonzero, so that it's put into data and not bss. | ||
| 48 | Link this file's object code first, so that this symbol is near the | ||
| 49 | start of data. */ | ||
| 50 | char data_start[1] = { 1 }; | ||
| 51 | # endif | ||
| 52 | #endif | ||
| 23 | 53 | ||
| 24 | /* | 54 | /* |
| 25 | Level number of warnings already issued. | 55 | Level number of warnings already issued. |
| @@ -35,12 +65,20 @@ static enum warnlevel warnlevel; | |||
| 35 | 0 means don't issue them. */ | 65 | 0 means don't issue them. */ |
| 36 | static void (*warn_function) (const char *); | 66 | static void (*warn_function) (const char *); |
| 37 | 67 | ||
| 38 | /* Start of data space; can be changed by calling malloc_init. */ | 68 | /* Start of data space; can be changed by calling memory_warnings. */ |
| 39 | static void *data_space_start; | 69 | static char *data_space_start; |
| 40 | 70 | ||
| 41 | /* Number of bytes of writable memory we can expect to be able to get. */ | 71 | /* Number of bytes of writable memory we can expect to be able to get. */ |
| 42 | static size_t lim_data; | 72 | static size_t lim_data; |
| 43 | 73 | ||
| 74 | /* Return true if PTR cannot be represented as an Emacs Lisp object. */ | ||
| 75 | static bool | ||
| 76 | exceeds_lisp_ptr (void *ptr) | ||
| 77 | { | ||
| 78 | return (! USE_LSB_TAG | ||
| 79 | && VAL_MAX < UINTPTR_MAX | ||
| 80 | && ((uintptr_t) ptr & ~DATA_SEG_BITS) >> VALBITS != 0); | ||
| 81 | } | ||
| 44 | 82 | ||
| 45 | #ifdef HAVE_GETRLIMIT | 83 | #ifdef HAVE_GETRLIMIT |
| 46 | 84 | ||
| @@ -122,10 +160,12 @@ check_memory_limits (void) | |||
| 122 | { | 160 | { |
| 123 | #ifdef REL_ALLOC | 161 | #ifdef REL_ALLOC |
| 124 | extern void *(*real_morecore) (ptrdiff_t); | 162 | extern void *(*real_morecore) (ptrdiff_t); |
| 163 | #else | ||
| 164 | void *(*real_morecore) (ptrdiff_t) = 0; | ||
| 125 | #endif | 165 | #endif |
| 126 | extern void *(*__morecore) (ptrdiff_t); | 166 | extern void *(*__morecore) (ptrdiff_t); |
| 127 | 167 | ||
| 128 | void *cp; | 168 | char *cp; |
| 129 | size_t five_percent; | 169 | size_t five_percent; |
| 130 | size_t data_size; | 170 | size_t data_size; |
| 131 | enum warnlevel new_warnlevel; | 171 | enum warnlevel new_warnlevel; |
| @@ -135,13 +175,8 @@ check_memory_limits (void) | |||
| 135 | five_percent = lim_data / 20; | 175 | five_percent = lim_data / 20; |
| 136 | 176 | ||
| 137 | /* Find current end of memory and issue warning if getting near max */ | 177 | /* Find current end of memory and issue warning if getting near max */ |
| 138 | #ifdef REL_ALLOC | 178 | cp = (real_morecore ? real_morecore : __morecore) (0); |
| 139 | if (real_morecore) | 179 | data_size = cp - data_space_start; |
| 140 | cp = (char *) (*real_morecore) (0); | ||
| 141 | else | ||
| 142 | #endif | ||
| 143 | cp = (char *) (*__morecore) (0); | ||
| 144 | data_size = (char *) cp - (char *) data_space_start; | ||
| 145 | 180 | ||
| 146 | if (!warn_function) | 181 | if (!warn_function) |
| 147 | return; | 182 | return; |
| @@ -188,49 +223,10 @@ check_memory_limits (void) | |||
| 188 | warnlevel = warned_85; | 223 | warnlevel = warned_85; |
| 189 | } | 224 | } |
| 190 | 225 | ||
| 191 | if (EXCEEDS_LISP_PTR (cp)) | 226 | if (exceeds_lisp_ptr (cp)) |
| 192 | (*warn_function) ("Warning: memory in use exceeds lisp pointer size"); | 227 | (*warn_function) ("Warning: memory in use exceeds lisp pointer size"); |
| 193 | } | 228 | } |
| 194 | 229 | ||
| 195 | #if !defined (CANNOT_DUMP) || !defined (SYSTEM_MALLOC) | ||
| 196 | /* Some systems that cannot dump also cannot implement these. */ | ||
| 197 | |||
| 198 | /* | ||
| 199 | * Return the address of the start of the data segment prior to | ||
| 200 | * doing an unexec. After unexec the return value is undefined. | ||
| 201 | * See crt0.c for further information and definition of data_start. | ||
| 202 | * | ||
| 203 | * Apparently, on BSD systems this is etext at startup. On | ||
| 204 | * USG systems (swapping) this is highly mmu dependent and | ||
| 205 | * is also dependent on whether or not the program is running | ||
| 206 | * with shared text. Generally there is a (possibly large) | ||
| 207 | * gap between end of text and start of data with shared text. | ||
| 208 | * | ||
| 209 | */ | ||
| 210 | |||
| 211 | char * | ||
| 212 | start_of_data (void) | ||
| 213 | { | ||
| 214 | #ifdef BSD_SYSTEM | ||
| 215 | extern char etext; | ||
| 216 | return (void *) &etext; | ||
| 217 | #elif defined DATA_START | ||
| 218 | return (void *) DATA_START; | ||
| 219 | #elif defined ORDINARY_LINK | ||
| 220 | /* | ||
| 221 | * This is a hack. Since we're not linking crt0.c or pre_crt0.c, | ||
| 222 | * data_start isn't defined. We take the address of environ, which | ||
| 223 | * is known to live at or near the start of the system crt0.c, and | ||
| 224 | * we don't sweat the handful of bytes that might lose. | ||
| 225 | */ | ||
| 226 | return (void *) &environ; | ||
| 227 | #else | ||
| 228 | extern int data_start; | ||
| 229 | return (void *) &data_start; | ||
| 230 | #endif | ||
| 231 | } | ||
| 232 | #endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */ | ||
| 233 | |||
| 234 | /* Enable memory usage warnings. | 230 | /* Enable memory usage warnings. |
| 235 | START says where the end of pure storage is. | 231 | START says where the end of pure storage is. |
| 236 | WARNFUN specifies the function to call to issue a warning. */ | 232 | WARNFUN specifies the function to call to issue a warning. */ |
| @@ -240,10 +236,7 @@ memory_warnings (void *start, void (*warnfun) (const char *)) | |||
| 240 | { | 236 | { |
| 241 | extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ | 237 | extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ |
| 242 | 238 | ||
| 243 | if (start) | 239 | data_space_start = start ? start : data_start; |
| 244 | data_space_start = start; | ||
| 245 | else | ||
| 246 | data_space_start = start_of_data (); | ||
| 247 | 240 | ||
| 248 | warn_function = warnfun; | 241 | warn_function = warnfun; |
| 249 | __after_morecore_hook = check_memory_limits; | 242 | __after_morecore_hook = check_memory_limits; |